Well, the title of the most popular statement named, estimated that Baidu included, when we find the time will be more convenient.
iOS novice, this problem really debugging for a long time!
As a result of the start of large projects, but also do not have time from the foundation, I believe that most of the small company developers are this model. So many problems arise from very basic mistakes.
The project uses the MVC structure, after reading the data asynchronously, the data of the model in Nsarray is lost, the professional point is that the memory is released, and only the memory address is left.
Maybe everyone's situation is different from mine, so the solution is not necessarily the same.
The Project Server is an ASP. WebService, which uses afnetworking to read the data type XML, and then uses Gdataxmlnode to read the values in the XML to the new model, thus generating the nsarray of the model.
When the model is established, the parameter value of the property is set to
// Publisher name
@property(nonatomic,assign)nsstring *sendername;
Note that it is assign, OK, this way of building properties is to copy other code.
The problem is here, the property set assign, is the address reference, then after the call Gdataxmlnode, NSString is automatically freed, so in the Viewcontroller will not read the value.
You only need to modify the assign to copy.
// Publisher name
@property(nonatomic,retain)nsstring *sendername;
This is a very basic error, without understanding the memory release mechanism and properties of the case, to solve the problem is quite tricky, the following list this part of the basics, while doing learning it!
Introduction to @property Properties in iOS development: http://gaoyong.diandian.com/post/2011-11-02/6444165