English 中文(简体)
视像控制器记忆管理和数据传递方面的混乱
原标题:confused regarding uiviewcontroller memory management and passing data between them
  • 时间:2012-05-12 12:11:03
  •  标签:
  • ios

我是新到的SOS方案,一读了视力控制器方案规划指南,但我仍然不清楚某些情况。

  • View of a viewcontroller is destroyed but viewcontroller remains, there nothing specified regarding if I my self want to destroy any viewcontroller or I just missed it. VC guide says iOS destroy VC when memory start getting short for other resources and same goes for VC s view right? Need to understand memory management of VC, please read my second point.

  • 在一名军控员中,我有一张显示我的朋友名单的表像控制器,选择我的任何朋友,即把另一个甚小的聊天。 每次选择朋友时,问题都是为了创造新的聊天会。 每一位朋友,如果试图与他们交谈,这一聊天会是多么独特? 我也在拯救亚洲开发银行的信息,这样,朋友窗户打开或贴近信息,用户就不会有空白。 每一朋友都可能只使用一个聊天会场(只有特定朋友的电文显示并向他发送了我试图与他交谈的电文)。 我认为,这个问题与在视力控制器之间传递数据有关,但混淆不清。

I hope i have clearly define what i am confused in. Please ignore any silly mistakes.

谢谢。

最佳回答

对您提出的问题的答复:

  1. View of a viewcontroller is destroyed but view controller remains

According to UIViewController guide - It is responsible for creating those views and for relinquishing ownership of them at the appropriate times, including during low-memory conditions and when the view controller itself is released.

So we need to take the ownership to release a view controller. Also The UIViewController class provides some automatic handling of low-memory conditions through its didReceiveMemoryWarning method, which releases unneeded memory.

  1. In your Scenario-

表View->在点击下层视线时――>现在流行这一看法,以回头看(记忆中释放)->在表上再次看――和;在点击新电线控制器时,推推。

以此方式处理记忆。 如果是等级制度,我们就会推动某些观点,例如:

VC1 -> VC2 > VC3 -> VC4

现在,在这种情况下,导航控制员会把所有这些观点控制员的事例保留下来,因为导航控制员使我们具有倒退的灵活性。 一旦我们回头来看,控制器就会从分配给它的记分中删除。

使用的先天

Push a view controller -

[self.navigationController pushViewController:myViewController animated:YES];
[myViewController release];//at the time of push we add this release statement.

现在,当我们忙.的时候,我们就要求采用其交易方法,并从中删除。

[self.navigationController popViewControllerAnimated:YES];//That view is release from navigation stack

Hope this clears your doubt. Checkout this developer page for more details - http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ViewLoadingandUnloading/ViewLoadingandUnloading.html

问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签