I am developping an iPhone App that sends SMS, I am using XCode 4.2
basically I need it to generate a body and to add a phone number to the receipient .
I ran the application on an iPad and it crashed the application , when I went through the code and found out that the receipient line is making the problem when I remove this line it works perfectly fine and it directs to the messages application.
any clue how to avoid this problem ?
here is the Code I am using
MFMessageComposeViewController *sms = [[MFMessageComposeViewController alloc] init];
if ([MFMessageComposeViewController canSendText]) {
sms.recipients=[NSArray arrayWithObjects:@"1111111111"];
sms.body= @"test";
sms.messageComposeDelegate = self;
[self presentModalViewController:sms animated:YES];
}
the log :
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Fri Sep 16 06:56:50 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys000
sharedlibrary apply-load-rules all
target remote-mobile /tmp/.XcodeGDBRemote-692-73
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to process 7171 thread 0x1c03]
[Switching to process 7171 thread 0x1c03]
Re-enabling shared library breakpoint 1
Re-enabling shared library breakpoint 7
(gdb)
I get the following green error :
Tread1 : Program Received signal :"EXC_BAD_ACCESS"
and the following warning(yellow)
Missing sentinel dispatch
writing this as answer because i do not have privilege to comment.
i think the problem is with
which should be
EDIT :
or