这是我的代码
NSString *string = [NSString stringWithFormat:@" http://abc.com /Demo/View.php?drinkId=%@&name=%@&comment=%@&date=%@&rating=%@& ReqestType=SubmitComment",DrinkId,Name,Comment,Date,Rating];
NSURL *url = [[NSURL alloc] initWithString:string];
Run Code Online (Sandbox Code Playgroud)
这里的字符串有值,但url返回nil.任何人都能说出为什么会这样.
谢谢 ....
"这不行,所以这就是我做的事情"
NSString *string = [NSString stringWithFormat:@"http://abc.com/Demo/View.php?drinkId=%@&name=%@&comment=%@&date=%@&rating=%@&ReqestType=SubmitComment",DrinkId,Name,Comment,Date,Rating];
NSURL *url = [[NSURL alloc] initWithString:string];
Run Code Online (Sandbox Code Playgroud) 我想设计一个存储文档的应用程序iCloud.但是在实际实施之前有一些问题已经回答了.
问题如下,
有人可以帮我吗?我阅读了苹果文档,但并未完全了解所有内容.
提前致谢.
我在我的应用程序中使用以下代码,但它给出了一个stringWithContentsOfFile不推荐使用的警告.
谁能告诉我如何避免这种警告?这个警告将来会影响我的应用程序吗?
NSString *myData= [NSString stringWithContentsOfFile:path];
Run Code Online (Sandbox Code Playgroud) 我正在使用Web服务创建聊天应用程序.在这里,我将调用Web服务,在接收消息后,我必须在表视图中显示它们,我发送的任何内容也必须在表视图中显示.为此,我放置了UIText上方(上方)表视图的字段和我输入的任何内容和按下发送按钮消息显示在表中,并且每30秒后我调用get message service(对于这个我使用的带有定时器的线程)并且在从服务器接收消息之后reloaddata调用表视图中的所有数据显示,当键盘不可见但是当键盘出现并等待服务器响应时重新加载数据我的应用程序崩溃并提供以下错误消息时这种情况正常.
void _WebThreadLockFromAnyThread(bool), 0xc849490: Obtaining the web lock from a thread other than the main thread or the web thread. UIKit should not be called from a secondary thread.
bool _WebTryThreadLock(bool), 0xc849490: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now.
Run Code Online (Sandbox Code Playgroud) 我想将图像和文本(两者)复制到UIPasteBoard. 是否可以复制文本和图像.
在这里,我只能复制图像或仅复制文本.如何复制?
我的复制图像代码如下,
UIPasteboard *pasteBoard = [UIPasteboard pasteboardWithName:UIPasteboardNameGeneral create:NO];
pasteBoard.persistent = YES;
NSData *data = UIImagePNGRepresentation(newImage);
[pasteBoard setData:data forPasteboardType:(NSString *)kUTTypePNG];
Run Code Online (Sandbox Code Playgroud)
提前致谢 !!!!!