English 中文(简体)
• 如何下载X条码中的编号
原标题:How to download a .plist in xcode
  • 时间:2012-01-14 00:31:50
  •  标签:
  • xcode4.2

so I m making an iphone app, which needs to download a .plist from a server...

我知道如何制造和洗 to,并用一盘点文件做任何事情,但只是为我下载。

I ve tried using this code

NSMutableArray *profileArray;
profileArray = [[NSMutableArray Alloc] initWithContentsOfUrl:@"myurl.plist"];

but it always comes back with a (null) value, what should I do?

预收:D

问题回答

InitWithContentsOfUrl: 方法将NSURL物体作为参数。 你们需要像你那样,制造一只NSURL物体:

NSURL *url = [NSURL URLWithString: @"myurl.plist"];

then use this to instantiate the array:

NSMutableArray *profileArray; profileArray = [[NSMutableArray Alloc] initWithContentsOfUrl: url];




相关问题
Issue with compiling example code

I m trying to compile this sample code with XCode 4.2b, here s how my project looks like: Application type: Command Line Tool. When I m trying to build the project, I get the following list of errors:...

Storyboard Partial Cut remove

With the new xCode Storyboard function it is posible to switch the view with some prepared switch-modes like: Style: "Model" Transition: "Partial Cut" So I have tried to use the "Partial Cut", but ...

Xcode 4.2: What is the most effective method switching views?

I was thinking of games in particular, where there may be alot of views that need to be switched in and out. Could someone supply some sample xcode 4.2 code? Many tutorials have old xcode versions ...

热门标签