小编Vij*_*jay的帖子

NSURL返回Nil Value

这是我的代码

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)

objective-c nsurl

9
推荐指数
1
解决办法
8908
查看次数

用于上传和下载文件的iCloud Integration

我想设计一个存储文档的应用程序iCloud.但是在实际实施之前有一些问题已经回答了.

问题如下,

  1. 在iCloud上上传的最大文件大小是多少?
  2. 我可以通过编程方式计算/了解用户iCloud帐户的可用空间吗?
  3. 如何从iCloud上传和下载文件?

有人可以帮我吗?我阅读了苹果文档,但并未完全了解所有内容.

提前致谢.

ios icloud

8
推荐指数
1
解决办法
5481
查看次数

stringWithContentsOfFile已弃用

我在我的应用程序中使用以下代码,但它给出了一个stringWithContentsOfFile不推荐使用的警告.

谁能告诉我如何避免这种警告?这个警告将来会影响我的应用程序吗?

NSString *myData= [NSString stringWithContentsOfFile:path];
Run Code Online (Sandbox Code Playgroud)

nsstring

7
推荐指数
1
解决办法
6496
查看次数

WebTryThreadLock

我正在使用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)

multithreading objective-c ios

6
推荐指数
1
解决办法
6179
查看次数

将图像和文本复制到UIPasteboard

我想将图像和文本(两者)复制到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)

提前致谢 !!!!!

iphone uipasteboard

4
推荐指数
2
解决办法
4361
查看次数