开发者

how to add attribute to NSManagedobject

Actually at first I created a NSManagedobject with name addtofav with attributes songid, s开发者_运维技巧ongname, songlistid, imagepath, but now I want to add another attribute (i.e biography). Can you please guide me how to add an attribute to it?


double-click on the *.xcdatamodel file, navigate to the object class you want to change and add/delete etc the attribute....

To create the new class file, mark the class you just changed, goto the project explorer on the left and ctrl-click on the "NSData Classes" Folder where all your data classes are, now select "New File" -> "Core Data" -> "NS ManagedObject subclass". It will ask to replace your previous file. Be careful when replacing, if you have changed/added any code to your data classes yourself. Use categories to add your methods, so replacing the data classes does not delete your user added code in the replaced files....

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜