Tuesday 15 June 2010

ios - Setting a strong NSBlockOperation on a UIWebView. Is this a bad idea? -


I'm debugging an interesting issue with my app.

The app is targeted to iOS6.1 and it's using ARC. Here's some background because it's too big to copy paste in SO.

There is a dashboard class in which a child is the controller to view. This baby is large instead of the controller to see, there are two scrollable scenes that are dynamically created based on the coreata object that comes in the hands of the dashboard controller. Where the Dash Board Controller is done with the child controller, it destroys it and creates the other one separate core data object.

One of the baby controller's scenes which is created dynamically and is filled in the UIScrollView, the sub-section of UIWebView let's call it SubWeb when an example of SubWeb is created, then it's some other content ( To write on disk, encryption, etc.) uses a NSOperationBlock to fetch some files on the network. Once done this, it should be able to include a file or a webpage in this subweb example.

I have solved SubWeb by giving it a strong asset. This is my problem: My cleanliness is never able to destroy the child's visual controller or sub-caste; I have confirmed this with the study of the allocation of such devices that target my classes. By creating and destroying child viewing controllers (and SubWeb objects), I can see memory allocation for both children's view controller and sub-wWeb object, until the app crashes. What is odd is that when I set up NSBlockOperation to weaken, the result is the result of the loss.

I need strong references because I only start some subweb objects for a real file I load the user if I scroll over them, then I load the required file by pushing the lazy property

Here is the WebView when I see the child viewing controller and the subweb view. Ahrn I am talking about are not clear:

  #import & lt; UIKit / UIKit.h & gt; @ Interface MySubWebView: UIWebView @property (Strong) NSBlockOperation * fileLoadOperation; @end   

This is a webview when it is cleaned (but - now the lazy blockout operations are zero when I need them:

  #import & lt; UIKit / UIKit.h & gt; @interface MySubWebView: UIWebView @property (weak) NSBlockOperation * fileLoadOperation; @end   

The only difference is strong and weak type. Has anyone ever visited NSBLockOperation For the kind of sluggish loading action? Can I use a defender / better method to solve lazy load?

itemprop = "text">

I nsb I do not follow my logic to create lockOperation object strong , it should generally be weak . If the operation is complete, then < / P>

In response to the question of your memory consumption, you are getting out of memory because you definitely have a strong reference cycle (aka cycle intact). self Is the reference (whether pre-undoubtedly, or some examples of some of its controllers By referring to), you have a strong reference cycle (i.e., two objects that maintain strong references for each other, and thus do not manually clean it until it is manually cleaned Can not be distributed.)

For information about maintaining the cycle Advanced Memory Management Programming Guide. See also with the Programming with Objective-C guide.

3 comments:

  1. An intriguing discussion is definitely worth comment. I believe that you ought to publish more about this issue, it may not be a taboo subject but typically people do not speak about such issues. To the next! All the best!!

    KBC Head Office Contact Number
    Kbc Head Office Number Kolkata
    Jio Kbc Head Office Number
    Kbc Head Office Number Delhi
    Kbc Head Office Whatsapp Number Mumbai
    Kbc Head Office Real Number

    ReplyDelete
  2. Chennai's best software training institute, Infycle Technologies, offers the best Hadoop training in Chennai for students and tech professionals along with other courses such as Python, Oracle, Selenium, Java, Data Science, Cyber Security, Hadoop, iOS, and Android development with 100% hands-on training. Once the completion of training, the students will be sent for placement interviews in the core MNC's. Call 7504633633 to get more info and a free demo.Best Hadoop Training in Chennai | Infycle Technologies

    ReplyDelete