Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

beesbane

macrumors newbie
Original poster
Oct 16, 2010
21
0
I have been working on learning xcode and apps since may or so, and I am working on one now that passes information through xml, and populates an IB file.

The root view is a table view, and when one thing is selected, everything works, but when I navigate back to that view and try to load another, the information has not been released.

I am basing this model of of a sample code I was learning from, and it had passed the information into another tableView, and called reloadData after it had been loaded in. This function however, does not work with UITextView, or UILabel view. How would I do this instead?

The IBOutlets are properties, nonatomic, assign.

Thanks
 
reloadData works/is required as UITableViews have datasources that provide the data. Other views like labels and text views don't. There is no analogous concept. You simple set the text to display when you want to change the text displayed.
 
Wow, thanks for the quick response.

So all I need to do is set up the outlets? I don't need to release them or reload them or reset them?

for example:

UILabel.text = XMLString
 
So all I need to do is set up the outlets? I don't need to release them or reload them or reset them?

Outlets? If we are not talking about Interface Builder, where specific properties may be exposed as Outlets then that word makes no sense. Whether you need to release them or not depend on how you have got the string. You may or may not need to release a string after setting the text property of a UILabel (the UILabel will retain the string).
 
Yes, IBOutlets.

I need it to release, but can't get it to.

Here is what I'm doing:

.h

@interface FirstViewController : UIViewController {

IBOutlet UILabel *nameTitle;

XMLstuff *XMLinfo;

}

@property (nonatomic, retain) XMLstuff *XMLinfo;

//@property (nonatomic, assign) IBOutlet UILabel *nameTitle;


@end

.m

@synthesize XMLstuff;

- (void)viewDidLoad {
nameTitle.text = aBook.name;
[super viewDidLoad];
}

- (void)dealloc {

[XMLstuff release];
[nameTitle release];
}

result:

first selection works fine, return to root view, any other selection retains first selection's information.

I can't figure how to release or reload the data.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.