我的iOS应用程序中遇到了一些奇怪的问题.当我的应用程序打开并且用户按下睡眠/唤醒按钮时,应用程序调用
applicationWillResignActive
applicationDidEnterBackground
Run Code Online (Sandbox Code Playgroud)
当用户右键滑动解锁屏幕时,应用程序调用
applicationWillEnterForeground
applicationDidBecomeActive
Run Code Online (Sandbox Code Playgroud)
之后,它在控制台中输出以下错误:
PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0x1cdfbc00 {NSErrorFailingURLStringKey=https://gsp10-ssl.apple.com/use, NSErrorFailingURLKey=https://gsp10-ssl.apple.com/use, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0x1cddca10 "A server with the specified hostname could not be found."}
Run Code Online (Sandbox Code Playgroud)
我知道此错误表明找不到指定的主机名.但是哪个主机名?它是https://gsp10-ssl.apple.com/use还是我用于Web服务的主机名?
如何调试此错误并确定其来源?
我想在表格视图单元格中绘制线条,以便我可以将textfield和switch放在单个单元格中.我增加了细胞的高度.我怎样才能在细胞中划线?
我有UIView的子类,其中包含以下代码
//Get the CGContext from this view
CGContextRef context = UIGraphicsGetCurrentContext();
//Set the stroke (pen) color
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
//Set the width of the pen mark
CGContextSetLineWidth(context, 1.0);
// Draw a line
//Start at this point
CGContextMoveToPoint(context, 10.0, 30.0);
//Give instructions to the CGContext
//(move "pen" around the screen)
CGContextAddLineToPoint(context, 310.0, 30.0);
//Draw it
CGContextStrokePath(context);
Run Code Online (Sandbox Code Playgroud)
然后我有一个tableViewController与分组表格样式.在cellForRowAtIndexPath中,我有以下代码
//code to add textfield
DrawLineView *drawLine = [[DrawLineView alloc]init];
[cell addSubview:drawLine];
//code add switch
Run Code Online (Sandbox Code Playgroud)
但它没有划清界线.我不能使用2个不同的细胞.我得帮助我.这是我第一次处理iphone的图形.谢谢
我有UITableviewCell
子类.在那个单元格中,我有2个标签(lblComment
和lblDateTimeStampe
)和一个显示评级星的视图.我希望lblComment的动态高度适合所有文本.它应根据评论的长度在高度上扩展和缩小.我之前已经实现了这个,但没有像下面的AutoLayout
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *label = self.userComment.commentText;
CGSize stringSize = [label sizeWithFont:[UIFont boldSystemFontOfSize:15]
constrainedToSize:CGSizeMake(320, 9999)
lineBreakMode:UILineBreakModeWordWrap];
return stringSize.height+10;
}
Run Code Online (Sandbox Code Playgroud)
现在我正在使用AutoLayout功能.
如何使用Autolayout实现这一目标?
任何形式的帮助表示赞赏.谢谢
当我触发SELECT查询时,如何连接单行中的所有行?
我想要O/P喜欢
101 abc CA USA 102 xyz PH UK 103 pqr WDC EU
任何帮助都很感激.谢谢
我在iOS应用程序中首次使用故事板.我的故事板(A和B)中有2个视图.让我们说A是我的故事板中的初始视图控制器.当我的应用程序启动时,我可以看到视图控制器A.到目前为止,一切都按预期工作.现在在我的视图控制器A中,我正在检查用户是否已登录.如果用户没有登录,那么我想呈现视图控制器B.如何以编程方式使用PresentModalViewController以模态方式显示B?
这是我的设置
这是我的代码
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
if (!isUserLoggedIn) {
NSLog(@"USER NOT LOGGED IN....");
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
LoginViewController *vc = (LoginViewController*)[mainStoryboard instantiateViewControllerWithIdentifier:@"B"];
[self presentModalViewController:vc animated:YES];
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用iOS 6+中的社交框架在我的facebook朋友墙上发布iOS应用程序的邀请.但它给了我以下错误
error = {
code = 200;
message = "(#200) Feed story publishing to other users is disabled for this application";
type = OAuthException;
};
Run Code Online (Sandbox Code Playgroud)
我知道这是由于Facebook禁用Facebook博客和此stackoverflow问题中提到的此功能
在stackoverlow的页面上,写入使用feed对话框.但我看不到在Social框架中使用feed对话框的任何选项.
在iOS 6中使用Social Framewrok在朋友墙上进行POST的替代方法是什么?
任何形式的帮助表示赞赏.提前致谢.
在我的iOS应用程序中,服务器发送多种类型的推送通知.现在让我说我的应用程序在前台,用户正在使用我的应用程序.如果服务器一次向该用户发送多个推送通知,我该如何显示和处理这些推送通知?
我想过显示推送通知的警报视图,但由于我有多个推送通知,它会持续显示多个警报视图.此外,我需要区分有效负载,以便我可以加载显示正确的信息给用户.
现在我的问题是
1)同时处理多个推送通知的最佳方法是什么?
2)我可以实现内置推送通知横幅吗?Apple允许这样吗?如果是,任何参考都会有所帮助.
提前致谢.
我有支持iOS 6以及iOS 7的iOS应用程序.现在我在UITextView中显示包含电子邮件地址和网站网址的文本.在iOS 6中,UITextView正确检测到它,但在iOS 7中,它不会检测何时加载视图.但是,当我点击任何链接,电子邮件地址时,它开始检测所有链接/网址.
这是iOS 7中的错误还是我缺少一些专门针对iOS 7的设置?以下是应用程序的屏幕截图
1)在iOS 6+中加载视图时
2)在iOS 7中加载视图时
3)在iOS 7中点击任何链接/电子邮件地址
4)以下是我在UITextView的Interface builder中所做的设置.
我检查了一些链接,说明了,设置
textView.text = nil;
textView.text = @"My required info";
Run Code Online (Sandbox Code Playgroud)
但上面的代码没有运气.
任何人都可以告诉我哪里出错了?谢谢
ios6 ×4
ios ×2
iphone ×2
cgcontext ×1
dynamic ×1
events ×1
height ×1
ios5 ×1
ios7 ×1
mysql ×1
objective-c ×1
pbrequester ×1
singleton ×1
sleep ×1
uistoryboard ×1
uitableview ×1
uitextview ×1