{"id":180,"date":"2013-09-21T03:14:14","date_gmt":"2013-09-20T18:14:14","guid":{"rendered":"http:\/\/blog.ymyzk.com\/?p=180"},"modified":"2014-12-03T09:57:09","modified_gmt":"2014-12-03T00:57:09","slug":"ymnetworkactivitymanager","status":"publish","type":"post","link":"https:\/\/blog.ymyzk.com\/2013\/09\/ymnetworkactivitymanager\/","title":{"rendered":"NetworkActivityIndicator\u306e\u7ba1\u7406\u7528\u30af\u30e9\u30b9\u3092\u516c\u958b\u3057\u307e\u3057\u305f"},"content":{"rendered":"

iOS\u30a2\u30d7\u30ea\u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901a\u4fe1\u6642\u7b49\u306b\u30b9\u30c6\u30fc\u30bf\u30b9\u30d0\u30fc\u306b\u8868\u793a\u3059\u308b, NetworkActivityIndicator<\/a>\u3092\u7ba1\u7406\u3059\u308b,\u00a0YMNetworkActivityManager<\/a>\u3092\u516c\u958b\u3057\u307e\u3057\u305f.<\/p>\n

<\/p>\n

\u901a\u5e38, \u30a4\u30f3\u30b8\u30b1\u30fc\u30bf\u30fc\u306e\u8868\u793a\/\u975e\u8868\u793a\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u884c\u3044\u307e\u3059.<\/p>\n

\r\n[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;\r\n[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;\r\n<\/pre>\n

\u3057\u304b\u3057, \u3053\u306e\u65b9\u6cd5\u3067\u306f\u8907\u6570\u306e\u901a\u4fe1\u51e6\u7406\u3092\u540c\u6642\u306b\u884c\u3046\u5834\u5408\u306b, \u8868\u793a\/\u975e\u8868\u793a\u306e\u72b6\u614b\u7ba1\u7406\u304c\u9762\u5012\u306b\u306a\u308a\u307e\u3059.<\/p>\n

YMNetworkActivityManager\u3092\u5229\u7528\u3057, \u51e6\u7406\u958b\u59cb\u6642\u306bincrement, \u51e6\u7406\u7d42\u4e86\u6642\u306bdecrement\u3092\u547c\u3076\u3053\u3068\u306b\u3088\u3063\u3066, \u5185\u90e8\u3067\u5b9f\u884c\u4e2d\u306e\u901a\u4fe1\u51e6\u7406\u306e\u6570\u3092\u8a18\u61b6\u3055\u308c, \u3059\u3079\u3066\u306e\u901a\u4fe1\u51e6\u7406\u304c\u7d42\u4e86\u3057\u305f\u6642\u70b9\u3067\u81ea\u52d5\u7684\u306b\u30a4\u30f3\u30b8\u30b1\u30fc\u30bf\u30fc\u3092\u975e\u8868\u793a\u306b\u306a\u308a\u307e\u3059.<\/p>\n

\r\n[[YMNetworkActivityManager sharedManager] increment];\r\n[[YMNetworkActivityManager sharedManager] decrement];\r\n<\/pre>\n

\u307e\u305f, \u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30ab\u30a6\u30f3\u30bf\u3092\u30ea\u30bb\u30c3\u30c8\u3057\u3066, \u30a4\u30f3\u30b8\u30b1\u30fc\u30bf\u30fc\u3092\u975e\u8868\u793a\u306b\u3059\u308b\u3053\u3068\u3082\u51fa\u6765\u307e\u3059.<\/p>\n

\r\n[[YMNetworkActivityManager sharedManager] reset];\r\n<\/pre>\n

YMNetworkActivityManager\u306fiOS 5\u4ee5\u964d\u3067ARC\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u308b\u74b0\u5883\u4e0b\u3067\u5229\u7528\u3067\u304d\u307e\u3059.<\/p>\n","protected":false},"excerpt":{"rendered":"

iOS\u30a2\u30d7\u30ea\u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901a\u4fe1\u6642\u7b49\u306b\u30b9\u30c6\u30fc\u30bf\u30b9\u30d0\u30fc\u306b\u8868\u793a\u3059\u308b, NetworkActivityIndicator\u3092\u7ba1\u7406\u3059\u308b,\u00a0YMNetworkActivityManager\u3092\u516c\u958b\u3057\u307e\u3057\u305f.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,3],"tags":[11],"_links":{"self":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/180"}],"collection":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/comments?post=180"}],"version-history":[{"count":10,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/180\/revisions"}],"predecessor-version":[{"id":654,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/posts\/180\/revisions\/654"}],"wp:attachment":[{"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/media?parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/categories?post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ymyzk.com\/wp-json\/wp\/v2\/tags?post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}