我的联系人列表在模拟器中完美显示.它需要电话号码并将其放在文本框中.所以我决定在我的iphone上尝试它,它实际上执行我点击的东西.它调用数字而不是将数字放在文本框中.继承人代码:
- (IBAction) adressBook: (id) sender {
// creating the picker
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
// place the delegate of the picker to the controll
picker.peoplePickerDelegate = self;
// showing the picker
[self presentModalViewController:picker animated:YES];
// releasing
[picker release];
}
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker {
// assigning control back to the main controller
[self dismissModalViewControllerAnimated:YES];
}
- (BOOL)peoplePickerNavigationController: (ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
/*
ABMultiValueRef multi = ABRecordCopyValue(person, kABPersonPhoneProperty);
num.text = (NSString*)ABMultiValueCopyValueAtIndex(multi, 0);
//[self dismissModalViewControllerAnimated:YES];
*/
return YES;
}
- …Run Code Online (Sandbox Code Playgroud) 我使用Apple for MailComposer的代码,但当我尝试运行我的应用程序时,我收到一条错误消息,我无法构建我的应用程序.
我得到的消息错误:
没有找到符号(S)为i386硬件架构collect2:为i386硬件架构未定义的符号: "_OBJC_CLASS _ $ _ MFMailComposeViewController",从引用:objc级,裁判在InfoMailComposerViewController.o LD LD返回1个退出状态
知道这有什么意思吗?
提前致谢
我只想在外部显示器上显示全屏.
我正在使用这样的代码:
- (void) startTvOut {
NSArray *screens = [UIScreen screens];
CGSize max;
max.width = 0;
max.height = 0;
UIScreenMode *maxScreenMode = nil;
for (UIScreen *screen in screens)
{
if (screen != [UIScreen mainScreen])
{
for(int i = 0; i < [[screen availableModes] count]; i++)
{
UIScreenMode *current = [[screen availableModes] objectAtIndex: i];
if (current.size.width > max.width)
{
max = current.size;
maxScreenMode = current;
}
}
if (exWindow == nil)
{
exWindow = [[HUWindow alloc] initWithFrame:screen.brounds];
exWindow.backgroundColor = [UIColor whiteColor]; …Run Code Online (Sandbox Code Playgroud) 我需要知道在什么时候执行的方法;
1.)应用程序从后台恢复(如果我们将应用程序发送到后台,稍后当我们从后台恢复应用程序时)
2.)在使用应用程序时,屏幕被锁定,然后我们必须滑动锁定屏幕滑块才能进入应用程序.那么执行的方法是什么.
我是IOS的新手,如果我问一个愚蠢的问题,请提前抱歉.
我使用UITabBarController和navigationController来控制视图.
在我的最后一个视图中,我想在按下按钮时有一个按钮,视图将返回到我通过MainWindow.xib文件设置的rootViewController并杀死在app后台运行的任何进程.
在我想回到rootViewController之前,这是我在上一个视图中的代码:
-(IBAction)doneButtonPressed:(id)sender{
JourneyIndexViewController *journeyIndexVC = [[JourneyIndexViewController alloc] initWithNibName:@"JourneyIndexViewController" bundle:nil];
[journeyIndexVC setDistanceLabelValue:self.distanceLabelValue];
[self.navigationController pushViewController:journeyIndexVC animated:YES];
[journeyIndexVC release];
[self dismissModalViewControllerAnimated:YES];
}
Run Code Online (Sandbox Code Playgroud)
JourneyIndexViewController是我在MainWindow.xib中设置的rootViewController.
非常感谢您的支持.
我已经想出如何在我的iPhone应用程序中添加自定义日历,但我无法弄清楚如何将该日历添加到设备的日历中.从应用程序内部查看时,该事件显示正确的日历,但即使我点击事件的日历行,我的日历也不在列表中,如果我想保持日历名称正确,我必须取消.有没有办法'订阅'我本地创建的日历,以便我可以在设备上的日历应用程序中看到它(显然,我也希望它与用户的计算机等同步).
我正在尝试类似的东西[view removeFromSuperview]然而当我这样做时,从我看到的和我在苹果文档中看到的内容看来,正常的行为是从视图中移除superview(除非我有误读).
我想知道如何简单地从superview中删除一个视图,即在创建模态窗口的情况下,然后释放它,并在以后再次重绘
我试图在我的应用程序中本地化一个类(.h和.m文件).我进行了与我本地化界面相同的操作(xib - >获取信息 - > make file localizable).我创建了第二个.h和第二个.m文件,然后我对新位置进行了修改.好极了!
但它只是不起作用......
我收到错误:
重复符号_OBJC_METACLASS_
有人有线索吗 ?非常感谢 !
我正在解析包含时间戳的JSON文件.我想将此时间戳转换为NSDate.
我的代码:
NSString *depart=[alternates valueForKey:@"startTime"];
NSTimeInterval intervaldep=[depart doubleValue];
NSDate *myDate = [NSDate dateWithTimeIntervalSince1970:intervaldep];
Run Code Online (Sandbox Code Playgroud)
但是我的日期错了,例如:44135-04-01 03:20:00 +0000时间戳1330606668000.如有任何人有任何想法请帮助.谢谢.