MakeKeyAndVisible

I'm having an issue utilizing multiple 'window' objects. The symptom I am experiencing appears to be caused by calling the method 'makeKeyAndVisible' on a window +more than once+. In my example I have three (3) windows and all seems fine calling the method on each window the first time, however as soon as I call it on the window a second time I get a hang in the event loop as follows -
machmsgtrap
mach_msg
CFRunLoopRunSpecific
CFRunLoopRunInMode
GSEventRunModal
GSEventRun
-[UIApplication_run]
UIApplicationMain
main
I recognize that I may be doing something odd (and may even have a bug in my code) but it isn't obvious and then fact that each window work without issue the first time it is made the key window is leading me to believe that there may be an issue in the sdk as I experimented with commenting out the most complex window and activating the simplest window twice with the same results.
Please let me know if you have any success with multiple windows where you have been able to switch back and forth multiple times using makeKeyAndVisible.

There is a bug in makeKeyAndVisible, I changed my code to manually set the 'hidden' flag on each windows view to manage which should be visible and the issue has gone away.

Similar Messages

  • Program Crashing at sqlite3_Prepare help!!!!

    Hi guys,
    I am trying to make a program which inserts values into a sqlite database. For some reason my program crashes every time I press the button to insert the value. I have been trying to fix this for a long time but have not been able to fix it. Can you please have a look at my code and tell me what's wrong. Im going to put the code of my .m files on here.
    BpValue.m
    #import "BpValue.h"
    static sqlite3 *database = nil;
    static sqlite3_stmt *addStmt = nil;
    @implementation BpValue
    @synthesize valueID, value, isDirty, isDetailViewHydrated;
    + (void) finalizeStatements {
    if(database) sqlite3_close(database);
    if (addStmt) sqlite3_finalize(addStmt);
    - (id) initWithPrimaryKey:(NSInteger) pk {
    [super init];
    valueID = pk;
    isDetailViewHydrated = NO;
    return self;
    - (void) addValue {
    if(addStmt == nil) {
    const char *sql = "insert into BPressure(Value) Values(?)";
    if(sqlite3preparev2(database, sql, -1, &addStmt, NULL) != SQLITE_OK)
    NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
    sqlite3binddouble(addStmt, 1, [value doubleValue]);
    if(SQLITE_DONE != sqlite3_step(addStmt))
    NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database));
    else
    //SQLite provides a method to get the last primary key inserted by using sqlite3last_insertrowid
    valueID = sqlite3last_insertrowid(database);
    //Reset the add statement.
    sqlite3_reset(addStmt);
    - (void) dealloc {
    [value release];
    [super dealloc];
    @end
    MyViewController.m
    #import "MyViewController.h"
    #import "HelloWorldAppDelegate.h"
    #import "sqlite3.h"
    #import "BpValue.h"
    @implementation MyViewController
    @synthesize textField;
    @synthesize label;
    @synthesize string;
    - (IBAction)changeGreeting:(id)sender {
    HelloWorldAppDelegate *appDelegate = (HelloWorldAppDelegate *)[[UIApplication sharedApplication] delegate];
    BpValue *bpObj = [[BpValue alloc] initWithPrimaryKey:0];
    NSDecimalNumber *temp = [[NSDecimalNumber alloc] initWithString:textField.text];
    bpObj.value = temp;
    [temp release];
    self.string = textField.text;
    NSString *nameString = string;
    if ([nameString length] == 0) {
    nameString = @"World";
    NSString *greeting = [[NSString alloc] initWithFormat:@"Hello, %@!", nameString];
    label.text = greeting;
    //Add the object
    [appDelegate addValue:bpObj];
    [greeting release];
    - (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
    if (theTextField == textField) {
    [textField resignFirstResponder];
    return YES;
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
    // Initialization code
    return self;
    Implement loadView if you want to create a view hierarchy programmatically
    - (void)loadView {
    If you need to do additional setup after loading the view, override viewDidLoad.
    - (void)viewDidLoad {
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
    - (void)dealloc {
    [super dealloc];
    [label release];
    [string release];
    [super dealloc];
    @end
    HelloWorldAppDelegate.m
    #import "MyViewController.h"
    #import "HelloWorldAppDelegate.h"
    #import "BpValue.h"
    @implementation HelloWorldAppDelegate
    @synthesize window;
    @synthesize myViewController;
    @synthesize valuesArray;
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    //Copy database to the user's phone if needed.
    [self copyDatabaseIfNeeded];
    NSMutableArray *tempArray = [[NSMutableArray alloc] init];
    self.valuesArray = tempArray;
    [tempArray release];
    MyViewController *aViewController = [[MyViewController alloc]
    initWithNibName:@"ControllerView" bundle:[NSBundle mainBundle]];
    self.myViewController = aViewController;
    [aViewController release];
    UIView *controllersView = [myViewController view];
    [window addSubview:controllersView];
    [window makeKeyAndVisible];
    - (void)applicationWillTerminate:(UIApplication *)application {
    // Save data if appropriate
    //Save all the dirty coffee objects and free memory.
    [self.valuesArray makeObjectsPerformSelector:@selector(saveAllData)];
    [BpValue finalizeStatements];
    - (void)dealloc {
    [valuesArray release];
    [myViewController release];
    [window release];
    [super dealloc];
    - (void) copyDatabaseIfNeeded {
    //Using NSFileManager we can perform many file system operations.
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSError *error;
    NSString *dbPath = [self getDBPath];
    BOOL success = [fileManager fileExistsAtPath:dbPath];
    if(!success) {
    NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Database.sqlite"];
    success = [fileManager copyItemAtPath:defaultDBPath toPath:dbPath error:&error];
    if (!success)
    NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]);
    - (NSString *) getDBPath {
    //Search for standard documents using NSSearchPathForDirectoriesInDomains
    //First Param = Searching the documents directory
    //Second Param = Searching the Users directory and not the System
    //Expand any tildes and identify home directories.
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
    NSString *documentsDir = [paths objectAtIndex:0];
    return [documentsDir stringByAppendingPathComponent:@"Database.sqlite"];
    - (void) addValue:(BpValue *)bpObj {
    //Add it to the database.
    [bpObj addValue];
    //Add it to the coffee array.
    [valuesArray addObject:bpObj];
    @end
    Please if someone knows whats wrong, please tell me. It crashes at sqlite_prepare3. Following is part of the crash report
    Exception Type: EXCBADACCESS (SIGBUS)
    Exception Codes: KERNPROTECTIONFAILURE at 0x0000000000000030
    Crashed Thread: 0
    Application Specific Information:
    iPhone Simulator 1.0 (70), iPhone OS 2.0 (5A345)
    Thread 0 Crashed:
    0 libsqlite3.0.dylib 0x93d211f0 sqlite3Prepare + 48
    1 HelloWorld 0x000031c8 -BpValue addValue + 89 (BpValue.m:38)
    2 HelloWorld 0x00002b70 -HelloWorldAppDelegate addValue: + 36 (HelloWorldAppDelegate.m:84)
    3 HelloWorld 0x00002e6b -MyViewController changeGreeting: + 509 (MyViewController.m:41)
    4 UIKit 0x30a5e25e -UIApplication sendAction:to:from:forEvent: + 116
    5 UIKit 0x30abb022 -UIControl sendAction:to:forEvent: + 67
    6 UIKit 0x30abb4ea -UIControl(Internal) _sendActionsForEvents:withEvent: + 478
    7 UIKit 0x30aba830 -UIControl touchesEnded:withEvent: + 483
    8 UIKit 0x30a75c0b -UIWindow sendEvent: + 454
    9 UIKit 0x30a65e07 -UIApplication sendEvent: + 269
    10 UIKit 0x30a6522a _UIApplicationHandleEvent + 4407
    11 GraphicsServices 0x31699522 SendEvent + 35
    12 GraphicsServices 0x3169b88c PurpleEventTimerCallBack + 276
    13 com.apple.CoreFoundation 0x971be615 CFRunLoopRunSpecific + 3141
    14 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    15 GraphicsServices 0x31699d38 GSEventRunModal + 217
    16 GraphicsServices 0x31699dfd GSEventRun + 115
    17 UIKit 0x30a5dadb -UIApplication _run + 440
    18 UIKit 0x30a68ce4 UIApplicationMain + 1258
    19 HelloWorld 0x00002650 main + 102 (main.m:14)
    20 HelloWorld 0x000025be start + 54
    Thread 1:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 com.apple.CoreFoundation 0x971be0ce CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    4 WebCore 0x32a8a450 RunWebThread + 384
    5 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    6 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 2:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 GraphicsServices 0x3169ce0a EventReceiveThread + 467
    3 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    4 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 3:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 com.apple.CoreFoundation 0x971be0ce CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    4 com.apple.CFNetwork 0x95a59a32 CFURLCacheWorkerThread(void*) + 396
    5 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    6 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 0 crashed with X86 Thread State (32-bit):
    eax: 0x000040b0 ebx: 0x0000317d ecx: 0xffffffff edx: 0x00003e18
    edi: 0x00000000 esi: 0x004123a0 ebp: 0xbfffe5c8 esp: 0xbfffe470
    ss: 0x0000001f efl: 0x00010282 eip: 0x93d211f0 cs: 0x00000017
    ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
    cr2: 0x00000030

    thanks realized that soon after posting...everything works now yay!!

  • Program Crashing at sqlite_prepare3 help!!!!

    Hi guys,
    I am trying to make a program which inserts values into a sqlite database. For some reason my program crashes every time I press the button to insert the value. I have been trying to fix this for a long time but have not been able to fix it. Can you please have a look at my code and tell me what's wrong. Im going to put the code of my .m files on here.
    BpValue.m
    #import "BpValue.h"
    static sqlite3 *database = nil;
    static sqlite3_stmt *addStmt = nil;
    @implementation BpValue
    @synthesize valueID, value, isDirty, isDetailViewHydrated;
    + (void) finalizeStatements {
    if(database) sqlite3_close(database);
    if (addStmt) sqlite3_finalize(addStmt);
    - (id) initWithPrimaryKey:(NSInteger) pk {
    [super init];
    valueID = pk;
    isDetailViewHydrated = NO;
    return self;
    - (void) addValue {
    if(addStmt == nil) {
    const char *sql = "insert into BPressure(Value) Values(?)";
    if(sqlite3preparev2(database, sql, -1, &addStmt, NULL) != SQLITE_OK)
    NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
    sqlite3binddouble(addStmt, 1, [value doubleValue]);
    if(SQLITE_DONE != sqlite3_step(addStmt))
    NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database));
    else
    //SQLite provides a method to get the last primary key inserted by using sqlite3last_insertrowid
    valueID = sqlite3last_insertrowid(database);
    //Reset the add statement.
    sqlite3_reset(addStmt);
    - (void) dealloc {
    [value release];
    [super dealloc];
    @end
    MyViewController.m
    #import "MyViewController.h"
    #import "HelloWorldAppDelegate.h"
    #import "sqlite3.h"
    #import "BpValue.h"
    @implementation MyViewController
    @synthesize textField;
    @synthesize label;
    @synthesize string;
    - (IBAction)changeGreeting:(id)sender {
    HelloWorldAppDelegate *appDelegate = (HelloWorldAppDelegate *)[[UIApplication sharedApplication] delegate];
    BpValue *bpObj = [[BpValue alloc] initWithPrimaryKey:0];
    NSDecimalNumber *temp = [[NSDecimalNumber alloc] initWithString:textField.text];
    bpObj.value = temp;
    [temp release];
    self.string = textField.text;
    NSString *nameString = string;
    if ([nameString length] == 0) {
    nameString = @"World";
    NSString *greeting = [[NSString alloc] initWithFormat:@"Hello, %@!", nameString];
    label.text = greeting;
    //Add the object
    [appDelegate addValue:bpObj];
    [greeting release];
    - (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
    if (theTextField == textField) {
    [textField resignFirstResponder];
    return YES;
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
    // Initialization code
    return self;
    Implement loadView if you want to create a view hierarchy programmatically
    - (void)loadView {
    If you need to do additional setup after loading the view, override viewDidLoad.
    - (void)viewDidLoad {
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
    - (void)dealloc {
    [super dealloc];
    [label release];
    [string release];
    [super dealloc];
    @end
    HelloWorldAppDelegate.m
    #import "MyViewController.h"
    #import "HelloWorldAppDelegate.h"
    #import "BpValue.h"
    @implementation HelloWorldAppDelegate
    @synthesize window;
    @synthesize myViewController;
    @synthesize valuesArray;
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    //Copy database to the user's phone if needed.
    [self copyDatabaseIfNeeded];
    NSMutableArray *tempArray = [[NSMutableArray alloc] init];
    self.valuesArray = tempArray;
    [tempArray release];
    MyViewController *aViewController = [[MyViewController alloc]
    initWithNibName:@"ControllerView" bundle:[NSBundle mainBundle]];
    self.myViewController = aViewController;
    [aViewController release];
    UIView *controllersView = [myViewController view];
    [window addSubview:controllersView];
    [window makeKeyAndVisible];
    - (void)applicationWillTerminate:(UIApplication *)application {
    // Save data if appropriate
    //Save all the dirty coffee objects and free memory.
    [self.valuesArray makeObjectsPerformSelector:@selector(saveAllData)];
    [BpValue finalizeStatements];
    - (void)dealloc {
    [valuesArray release];
    [myViewController release];
    [window release];
    [super dealloc];
    - (void) copyDatabaseIfNeeded {
    //Using NSFileManager we can perform many file system operations.
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSError *error;
    NSString *dbPath = [self getDBPath];
    BOOL success = [fileManager fileExistsAtPath:dbPath];
    if(!success) {
    NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Database.sqlite"];
    success = [fileManager copyItemAtPath:defaultDBPath toPath:dbPath error:&error];
    if (!success)
    NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]);
    - (NSString *) getDBPath {
    //Search for standard documents using NSSearchPathForDirectoriesInDomains
    //First Param = Searching the documents directory
    //Second Param = Searching the Users directory and not the System
    //Expand any tildes and identify home directories.
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
    NSString *documentsDir = [paths objectAtIndex:0];
    return [documentsDir stringByAppendingPathComponent:@"Database.sqlite"];
    - (void) addValue:(BpValue *)bpObj {
    //Add it to the database.
    [bpObj addValue];
    //Add it to the coffee array.
    [valuesArray addObject:bpObj];
    @end
    Please if someone knows whats wrong, please tell me. It crashes at sqlite_prepare3. Following is part of the crash report
    Exception Type: EXCBADACCESS (SIGBUS)
    Exception Codes: KERNPROTECTIONFAILURE at 0x0000000000000030
    Crashed Thread: 0
    Application Specific Information:
    iPhone Simulator 1.0 (70), iPhone OS 2.0 (5A345)
    Thread 0 Crashed:
    0 libsqlite3.0.dylib 0x93d211f0 sqlite3Prepare + 48
    1 HelloWorld 0x000031c8 -[BpValue addValue] + 89 (BpValue.m:38)
    2 HelloWorld 0x00002b70 -[HelloWorldAppDelegate addValue:] + 36 (HelloWorldAppDelegate.m:84)
    3 HelloWorld 0x00002e6b -[MyViewController changeGreeting:] + 509 (MyViewController.m:41)
    4 UIKit 0x30a5e25e -[UIApplication sendAction:to:from:forEvent:] + 116
    5 UIKit 0x30abb022 -[UIControl sendAction:to:forEvent:] + 67
    6 UIKit 0x30abb4ea -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 478
    7 UIKit 0x30aba830 -[UIControl touchesEnded:withEvent:] + 483
    8 UIKit 0x30a75c0b -[UIWindow sendEvent:] + 454
    9 UIKit 0x30a65e07 -[UIApplication sendEvent:] + 269
    10 UIKit 0x30a6522a _UIApplicationHandleEvent + 4407
    11 GraphicsServices 0x31699522 SendEvent + 35
    12 GraphicsServices 0x3169b88c PurpleEventTimerCallBack + 276
    13 com.apple.CoreFoundation 0x971be615 CFRunLoopRunSpecific + 3141
    14 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    15 GraphicsServices 0x31699d38 GSEventRunModal + 217
    16 GraphicsServices 0x31699dfd GSEventRun + 115
    17 UIKit 0x30a5dadb -[UIApplication _run] + 440
    18 UIKit 0x30a68ce4 UIApplicationMain + 1258
    19 HelloWorld 0x00002650 main + 102 (main.m:14)
    20 HelloWorld 0x000025be start + 54
    Thread 1:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 com.apple.CoreFoundation 0x971be0ce CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    4 WebCore 0x32a8a450 RunWebThread + 384
    5 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    6 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 2:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 GraphicsServices 0x3169ce0a EventReceiveThread + 467
    3 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    4 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 3:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 com.apple.CoreFoundation 0x971be0ce CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    4 com.apple.CFNetwork 0x95a59a32 CFURLCacheWorkerThread(void*) + 396
    5 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    6 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 0 crashed with X86 Thread State (32-bit):
    eax: 0x000040b0 ebx: 0x0000317d ecx: 0xffffffff edx: 0x00003e18
    edi: 0x00000000 esi: 0x004123a0 ebp: 0xbfffe5c8 esp: 0xbfffe470
    ss: 0x0000001f efl: 0x00010282 eip: 0x93d211f0 cs: 0x00000017
    ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
    cr2: 0x00000030

    works now...hadn't initialized the database

  • Learning iPhone SDK - Trying to draw an image

    Although I have programmed for Mac in the last years, I have never used Mac-specific technologies as Cocoa (I have programmed more in OpenGL, SDL, and the like).
    Now I am getting started with the iPhone SDK. I'd like to do some OpenGL|ES stuff, but since it is not supported in the Simulator, and you need to join the Developer Program to test stuff on directly on the device (and admission of new members is closed right now), I am focused on other stuff right now, like using Core Graphics for drawing images on the iPhone.
    My application is based on the Cocoa Touch Application template. I left the default code except for a few changes.
    In file "UntitledAppDelegate.m", I have changed the method applicationDidFinishLaunching to:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    contentView = [[[MyView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
    [window addSubview:contentView];
    [window makeKeyAndVisible];
    Then, in the MyView interface file (MyView.h), I have added the attribute "UIImageView* image;" to the class, which is declared as a property, and synthesized.
    In the class implementation (MyView.m), I have changed the method initWithFrame to:
    - (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
    self.backgroundColor = [UIColor darkGrayColor];
    image = [self loadImageView:@"box01.png"];
    [self addSubview:image];
    return self;
    loadImageView is a private method I have implemented as:
    - (UIImageView *)loadImageView:(NSString *) imageName {
    UIImage *img = [UIImage imageNamed:imageName];
    UIImageView *theView = [[UIImageView alloc] initWithImage:img];
    return theView;
    Since I have loaded the UIImage, and initialized a UIImageView with it, and the image view is added as a subview of the main view attached to the window, I thought it should be everything needed to draw an image on the screen. But nothing is visible. The screen is simply black when I run this on the Simulator. It doesn't even set the background to dark gray.
    So I need some help with this, I sure that anyone with experience in Mac programming will know how to help me.
    Thank you in advance.
    Message was edited by: Jedive

    I removed the XIB file from the project, but that didn't help. It was a problem with my inexperience with Objective-C. When accessing class properties in a method of the same class, i was not putting "self." before the property (in C++ that's redundant). For example, in the line "window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];". After adding it, it works correctly.

  • What is the advantage of using IB to create XIBs/Class Objects over coding?

    Hi all,
    I hoping someone can provide me some pros and cons as to when I should use IB to create XIBs and/or class objects as opposed to directly coding them.
    For example, if I choose Apple's Template for creating a Navigation Based Application (cocoa touch), the project creates two NIB files - MainMenu and RootViewController.
    However looking at one of demo apps SimpleDrillDown, it does not have a RootViewController XIB and instead creates it via code.
    Another example from the same two apps is that the template generates a "Navigation Controller" class object in the Mainmenu.xib. SimpleDrillDown does not bother with this in the XIB, but uses code to generate the controller:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Create the navigation and view controllers
    RootViewController *rootViewController = [[RootViewController alloc] init];
    UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
    self.navigationController = aNavigationController;
    [aNavigationController release];
    [rootViewController release];
    // Configure and show the window
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
    as opposed to the template which only needs this:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    // Configure and show the window
    // Navigation Controller is defined in MainWindow.xib
    [window addSubview:[navigationController view]];
    [window makeKeyAndVisible];
    So what are the advantages of each approach. Why does apple suggest one approach and yet all its demos use another.
    Any thoughts, answers gratefully received.
    TIA, Michael.

    You can do whatever you're comfortable with, but most of the best Cocoa programmers--the ones on the Mac, I mean--recommend putting everything you can into Interface Builder.
    It's a little like the difference between writing a program to do a bunch of financial calculations and using a spreadsheet. Yeah, the program can do everything the spreadsheet can--and more besides--but you'll find it far easier to create, use and modify the spreadsheet.
    Interface Builder takes away a lot of completely meaningless choices ("What order should I create the objects in? How should I name the variables? How should I create their frames? What order should I set the attributes in?"), leaving you with an interface optimized for creating and arranging objects, and allowing your code to focus on what you really do need to think about--your application's logic.
    (By the way--part of the reason Apple's demos don't all use Interface Builder is that the very first SDK releases didn't have it. Back then, you had to create all your views programatically. Believe me, I have no wish to go back to setting autoresize masks manually. Now get off my lawn, whippersnapper.)

  • Launch a splash screen when an iPhone app starts

    Hi, I am trying to make a simple game for the iPhone, and when the app launches, I want a splash screen with instructions to come up. I also want the user to be able to push anywhere on the screen to dismiss it. However, the splash screen doesn't load! I made a new nib file with the splash screen, created a view controller, and a UIView subclass for the screen. Then, I inserted this code into the applicationDidFinishLaunching method of the app delegate:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    [window addSubview:[splashViewController view]];
    splashViewIsCurrentView = YES;
    [window makeKeyAndVisible];
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    if(splashViewIsCurrentView) {
    [[splashViewController view] removeFromSuperview];
    [window addSubview:[gameViewController view]];
    splashViewIsCurrentView = NO;
    I forgot to mention, in interface builder, I made the splash view's class as SplashView, and the File's Owner as the SplashViewController. Also, splashViewIsCurrentView is a boolean I made.

    I like the idea behind your use of "splashViewIsCurrentView". I think that may solve my problem.
    I too have a full-screen instruction view pop up over the main input view of the app. The instruction view is added as a subview of the main input view. I want to dismiss the instruction view with a touch. However, in the instruction view view controller, the touch even methods are not fired - even after twiddling with enabling user interaction on the instruction view and its subviews of label and fiddling with their frame sizes. While the instruction view is displayed over the main input view, the touch events are actually still associated with the main input view (and its controls) underneath. Seems like I am forgetting something but i don't know what.
    Your solution will probably work well and it is similar to what I was originally doing in handling the touch events in the main input view view controller. However, technically, it seems kludgy to not be able to handle the touch events in the instruction view view controller where it seems to make more sense to do so.
    Would you or anyone else know why or have any suggestions on things to look out for? The view and controls involved are all supposed to be descendants of UIResponder. Is there a bug or restriction I'm not aware of? Wondering why you went the route you did. Seems like you may have run up against what I am currently facing.

  • How to access the serial port on sdk 3.1.3 ?

    Hi all,
    I know that accessing serial port is not possible on firmware 2.x for non jailbroken iPhones.
    But what about firmware 3.0?
    Apple has focused firmware 3.0 on accessories, through bluetooth or through serial port. So, accessing serial port should be possible.
    But I can't find any documentation / sample code for that.
    Would you please help me?
    Regards,
    Alx
    PS: I tried to read the port /dev/cu.iap and get this message:
    Error opening serial port /dev/cu.iap - Permission denied(13).
    Looks bad.

    Yes I am enregistred in the Mad For iPod program?
    And I try to communique with my accessorie
    So the Code
    +*// SerialPortsModuleAppDelegate.m*+
    +*// SerialPortsModule*+
    +*// Created by BPO iMac on 08/02/10.*+
    +*// Copyright _MyCompanyName_ 2010. All rights reserved.*+
    +*#import "SerialPortsModuleAppDelegate.h"*+
    +*#import <fcntl.h>*+
    +*@implementation SerialPortsModuleAppDelegate*+
    +*@synthesize window;*+
    +*- (void)applicationDidFinishLaunching:(UIApplication *)application {*+
    +*// Override point for customization after application launch*+
    +*[window makeKeyAndVisible];*+
    +* portSerie = [SerialManager alloc];*+
    +* [portSerie init];*+
    +* int nb_port;*+
    +* nb_port = [portSerie findRS232Ports];*+
    +* NSString path_port;+
    +* path_port = [NSString alloc];*+
    +* int num_port;*+
    +* if(nb_port!=0)*+
    +* {*+
    +* num_port=0;*+
    +* path_port=[portSerie pathAtIndex:num_port];*+
    +* int resultat= [portSerie openInput:path_port baudrate:9600 bits:8 parity:0 stopbits:1 flags:O_RDONLY];*+
    +* if(resultat==-1)*+
    +* {*+
    +* NSLog(@"Communication Error");*+
    +* }*+
    +* resultat= [portSerie openOutput:path_port baudrate:9600 bits:8 parity:0 stopbits:1];*+
    +* if(resultat==-1)*+
    +* {*+
    +* NSLog(@"Communication Error");*+
    +* }*+
    +* }*+
    +* [path_port release];*+
    +* *+
    +*- (void)dealloc {*+
    +*[window release];*+
    +*[super dealloc];*+
    @end
    +*// SerialPortsModuleAppDelegate.h*+
    +*// SerialPortsModule*+
    +*// Created by BPO iMac on 08/02/10.*+
    +*// Copyright _MyCompanyName_ 2010. All rights reserved.*+
    +*#import <UIKit/UIKit.h>*+
    +*#import "SerialManager.h"*+
    +*@interface SerialPortsModuleAppDelegate : NSObject <UIApplicationDelegate> {*+
    +*UIWindow window;+
    +* SerialManager portSerie;+
    +*@property (nonatomic, retain) IBOutlet UIWindow window;+
    @end
    +*// SerialManager.m*+
    +*// K3 Tools*+
    +*// Created by Kok Chen on 4/28/09.*+
    +*// Copyright 2009 Kok Chen, W7AY. All rights reserved.*+
    +*#import "SerialManager.h"*+
    +*#include <unistd.h>*+
    +*#include <termios.h>*+
    +*#include <sys/ioctl.h>*+
    +*#include <IOKit/IOKitLib.h>*+
    +*#include <IOKit/serial/IOSerialKeys.h>*+
    +*#import <fcntl.h>*+
    +*#import <UIKit/UIKit.h>*+
    +*@implementation SerialManager*+
    +*- (id)init*+
    +* self = [ super init ] ;*+
    +* if ( self ) {*+
    +* termiosBits = -1 ;*+
    +* inputfd = outputfd = -1 ;*+
    +* useTermiosThread = NO ;*+
    +* needsNotification = NO ;*+
    +* termioLock = [ [ NSLock alloc ] init ] ;*+
    +* }*+
    +* return self ;*+
    +*static int findPorts( CFStringRef *stream, CFStringRef *path, int maxDevice, CFStringRef type )*+
    +*kernreturnt kernResult ;*+
    +*machportt masterPort ;*+
    +* ioiteratort serialPortIterator ;*+
    +* ioobjectt modemService ;*+
    +*CFMutableDictionaryRef classesToMatch ;*+
    +* CFStringRef cfString ;*+
    +* int count ;*+
    +*kernResult = IOMasterPort( MACHPORTNULL, &masterPort ) ;*+
    +*if ( kernResult != KERN_SUCCESS ) return 0 ;*+
    +* *+
    +*classesToMatch = IOServiceMatching( kIOSerialBSDServiceValue ) ;*+
    +*if ( classesToMatch == NULL ) return 0 ;*+
    +* *+
    +* // get iterator for serial ports (including modems)*+
    +* CFDictionarySetValue( classesToMatch, CFSTR(kIOSerialBSDTypeKey), type ) ;*+
    +*kernResult = IOServiceGetMatchingServices( masterPort, classesToMatch, &serialPortIterator ) ;*+
    +* // walk through the iterator*+
    +* count = 0 ;*+
    +* while ( ( modemService = IOIteratorNext( serialPortIterator ) ) ) {*+
    +* if ( count >= maxDevice ) break ;*+
    +*cfString = IORegistryEntryCreateCFProperty( modemService, CFSTR(kIOTTYDeviceKey), kCFAllocatorDefault, 0 ) ;*+
    +*if ( cfString ) {*+
    +* stream[count] = cfString ;*+
    +* cfString = IORegistryEntryCreateCFProperty( modemService, CFSTR(kIOCalloutDeviceKey), kCFAllocatorDefault, 0 ) ;*+
    +* if ( cfString ) {*+
    +* path[count] = cfString ;*+
    +* count++ ;*+
    +* }*+
    +* }*+
    +*IOObjectRelease( modemService ) ;*+
    +* IOObjectRelease( serialPortIterator ) ;*+
    +* return count ;*+
    +*// return number of ports*+
    +*- (int)findPorts:(CFStringRef)type*+
    +* CFStringRef cstream[64], cpath[64] ;*+
    +* int i ;*+
    +* *+
    +* numberOfPorts = findPorts( cstream, cpath, 64, type ) ;*+
    +* for ( i = 0; i < numberOfPorts; i++ ) {*+
    +* stream = [ [ NSString stringWithString:(NSString*)cstream ] retain ] ;*+
    +* CFRelease( cstream ) ;*+
    +* path = [ [ NSString stringWithString:(NSString*)cpath ] retain ] ;*+
    +* CFRelease( cpath ) ;*+
    +* }*+
    +* return numberOfPorts ;*+
    +*- (int)findPorts*+
    +* return [ self findPorts:CFSTR( kIOSerialBSDAllTypes ) ] ;*+
    +*- (int)findModems*+
    +* return [ self findPorts:CFSTR( kIOSerialBSDModemType ) ] ;*+
    +*- (int)findRS232Ports*+
    +* return [ self findPorts:CFSTR( kIOSerialBSDRS232Type ) ] ;*+
    +*- (NSString)streamAtIndex:(int)n+
    +* if ( n < 0 || n >= numberOfPorts ) return nil ;*+
    +* return stream[n] ;*+
    +*- (NSString)pathAtIndex:(int)n+
    +* if ( n < 0 || n >= numberOfPorts ) return nil ;*+
    +* return path[n] ;*+
    +*// common function to open port and set up serial port parameters*+
    +*static int openPort( NSString *path, int speed, int bits, int parity, int stops, int openFlags, Boolean input )*+
    +* int fd, cflag ;*+
    +* struct termios termattr ;*+
    +* *+
    +* fd = open( [ path cStringUsingEncoding:NSASCIIStringEncoding], openFlags ) ;*+
    +* if ( fd < 0 ) return -1 ;*+
    +* *+
    +* // build other flags*+
    +* cflag = 0 ;*+
    +* cflag |= ( bits == 7 ) ? CS7 : CS8 ; // bits*+
    +* if ( parity != 0 ) {*+
    +* cflag |= PARENB ; // parity*+
    +* if ( parity == 1 ) cflag |= PARODD ;*+
    +* }*+
    +* if ( stops > 1 ) cflag |= CSTOPB ;*+
    +* *+
    +* // merge flags into termios attributes*+
    +* tcgetattr( fd, &termattr ) ;*+
    +* termattr.c_cflag &= ~( CSIZE | PARENB | PARODD | CSTOPB ) ; // clear all bits and merge in our selection*+
    +* termattr.c_cflag |= cflag ;*+
    +* *+
    +* // set speed, split speed not support on Mac OS X?*+
    +* cfsetispeed( &termattr, speed ) ;*+
    +* cfsetospeed( &termattr, speed ) ;*+
    +* // set termios*+
    +* tcsetattr( fd, TCSANOW, &termattr ) ;*+
    +* return fd ;*+
    +*- (int)openInput:(NSString*)pathname baudrate:(int)speed bits:(int)bits parity:(int)parity stopbits:(int)stops flags:(int)openFlags*+
    +* return ( inputfd = openPort( pathname, speed, bits, parity, stops, openFlags, YES ) ) ;*+
    +*- (int)openInput:(NSString*)pathname baudrate:(int)speed bits:(int)bits parity:(int)parity stopbits:(int)stops*+
    +* return ( inputfd = openPort( pathname, speed, bits, parity, stops, ( O_RDONLY | O_NOCTTY | O_NDELAY ), YES ) ) ;*+
    +*- (int)openOutput:(NSString*)pathname baudrate:(int)speed bits:(int)bits parity:(int)parity stopbits:(int)stops flags:(int)openFlags*+
    +* return ( outputfd = openPort( pathname, speed, bits, parity, stops, openFlags, NO ) ) ;*+
    +*- (int)openOutput:(NSString*)pathname baudrate:(int)speed bits:(int)bits parity:(int)parity stopbits:(int)stops*+
    +* return ( outputfd = openPort( pathname, speed, bits, parity, stops, ( O_WRONLY | O_NOCTTY | O_NDELAY ), NO ) ) ;*+
    +*- (void)closeInput*+
    +* if ( inputfd > 0 ) close( inputfd ) ;*+
    +*- (void)closeOutput*+
    +* if ( outputfd > 0 ) close( outputfd ) ;*+
    +*- (int)inputFileDescriptor*+
    +* return inputfd ;*+
    +*- (int)outputFileDescriptor*+
    +* return outputfd ;*+
    +*- (int)getTermios*+
    +* int bits ;*+
    +* *+
    +* if ( inputfd > 0 ) {*+
    +* [ termioLock lock ] ;*+
    +* ioctl( inputfd, TIOCMGET, &bits ) ;*+
    +* [ termioLock unlock ] ;*+
    +* return bits ;*+
    +* }*+
    +* return 0 ;*+
    +*- (void)setRTS:(Boolean)state*+
    +* int bits ;*+
    +* if ( inputfd > 0 ) {*+
    +* [ termioLock lock ] ;*+
    +* ioctl( inputfd, TIOCMGET, &bits ) ;*+
    +* if ( state ) bits |= TIOCM_RTS ; else bits &= ~( TIOCM_RTS ) ;*+
    +* ioctl( inputfd, TIOCMSET, &bits ) ;*+
    +* [ termioLock unlock ] ;*+
    +* }*+
    +*- (void)setDTR:(Boolean)state*+
    +* int bits ;*+
    +* if ( inputfd > 0 ) {*+
    +* [ termioLock lock ] ;*+
    +* ioctl( inputfd, TIOCMGET, &bits ) ;*+
    +* if ( state ) bits |= TIOCM_DTR ; else bits &= ~( TIOCM_DTR ) ;*+
    +* ioctl( inputfd, TIOCMSET, &bits ) ;*+
    +* [ termioLock unlock ] ;*+
    +* }*+
    +*// IO Notifications*+
    +*// prototype for delegate*+
    +*- (void)port:(NSString*)name added:(Boolean)added*+
    +* if ( delegate && [ delegate respondsToSelector:@selector(port:added:) ] ) [ delegate port:name added:added ] ;*+
    +*// this is called from deviceAdded() and deviceRemoved() callbacks*+
    +*- (void)portsChanged:(Boolean)added iterator:(ioiteratort)iterator*+
    +* ioobjectt modemService ;*+
    +* CFStringRef cfString ;*+
    +* while ( ( modemService = IOIteratorNext( iterator ) ) > 0 ) {*+
    +* cfString = IORegistryEntryCreateCFProperty( modemService, CFSTR( kIOTTYDeviceKey ), kCFAllocatorDefault, 0 ) ;*+
    +* if ( cfString ) {*+
    +* [ self port:(NSString*)cfString added:added ] ;*+
    +* CFRelease( cfString ) ;*+
    +* }*+
    +* IOObjectRelease( modemService ) ;*+
    +* }*+
    +*// callback notification when device added*+
    +*static void deviceAdded(void *refcon, ioiteratort iterator )*+
    +* ioobjectt modemService ;*+
    +* *+
    +* if ( refcon ) [ (SerialManager*)refcon portsChanged:YES iterator:iterator ] ;*+
    +* else {*+
    +* while ( modemService = IOIteratorNext( iterator ) ) IOObjectRelease( modemService ) ;*+
    +* }*+
    +*static void deviceRemoved(void *refcon, ioiteratort iterator )*+
    +* ioobjectt modemService ;*+
    +* *+
    +* if ( refcon ) [ (SerialManager*)refcon portsChanged:NO iterator:iterator ] ;*+
    +* else {*+
    +* while ( modemService = IOIteratorNext( iterator ) ) IOObjectRelease( modemService ) ;*+
    +* }*+
    +*- (void)startNotification*+
    +* CFMutableDictionaryRef matchingDict ;*+
    +* *+
    +* notifyPort = IONotificationPortCreate( kIOMasterPortDefault ) ;*+
    +* CFRunLoopAddSource( CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource( notifyPort ), kCFRunLoopDefaultMode ) ;*+
    +* matchingDict = IOServiceMatching( kIOSerialBSDServiceValue ) ;*+
    +* CFRetain( matchingDict ) ;*+
    +* CFDictionarySetValue( matchingDict, CFSTR(kIOSerialBSDTypeKey), CFSTR( kIOSerialBSDAllTypes ) ) ;*+
    +* *+
    +* IOServiceAddMatchingNotification( notifyPort, kIOFirstMatchNotification, matchingDict, deviceAdded, self, &addIterator ) ;*+
    +* deviceAdded( nil, addIterator ) ; // set up addIterator*+
    +* IOServiceAddMatchingNotification( notifyPort, kIOTerminatedNotification, matchingDict, deviceRemoved, self, &removeIterator ) ;*+
    +* deviceRemoved( nil, removeIterator ) ; // set up removeIterator*+
    +*- (void)stopNotification*+
    +* if ( addIterator ) {*+
    +* IOObjectRelease( addIterator ) ;*+
    +* addIterator = 0 ;*+
    +* }*+
    +* if ( removeIterator ) {*+
    +* IOObjectRelease( removeIterator ) ;*+
    +* removeIterator = 0 ;*+
    +* }*+
    +* if ( notifyPort ) {*+
    +* CFRunLoopRemoveSource( CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource( notifyPort ), kCFRunLoopDefaultMode ) ;*+
    +* IONotificationPortDestroy( notifyPort ) ;*+
    +* notifyPort = nil ;*+
    +* }*+
    +*// prototype for delegate or subclass*+
    +*- (void)controlFlagsChanged:(int)termbits*+
    +* if ( delegate && [ delegate respondsToSelector:@selector(controlFlagsChanged:) ] ) [ delegate controlFlagsChanged:termbits ] ;*+
    +*- (void)termiosThread*+
    +* NSAutoreleasePool *pool = [ [ NSAutoreleasePool alloc ] init ] ;*+
    +* int termbits ;*+
    +* while ( 1 ) {*+
    +* if ( useTermiosThread == NO ) break ;*+
    +* if ( inputfd > 0 ) {*+
    +* if ( [ termioLock tryLock ] ) {*+
    +* ioctl( inputfd, TIOCMGET, &termbits ) ;*+
    +* if ( termiosBits != termbits ) [ self controlFlagsChanged:termbits ] ;*+
    +* termiosBits = termbits ;*+
    +* [ termioLock unlock ] ;*+
    +* }*+
    +* [ NSThread sleepUntilDate:[ NSDate dateWithTimeIntervalSinceNow:0.25 ] ] ;*+
    +* }*+
    +* else {*+
    +* [ NSThread sleepUntilDate:[ NSDate dateWithTimeIntervalSinceNow:1.0 ] ] ;*+
    +* }*+
    +* }*+
    +* [ pool release ] ;*+
    +*// If delegate is set, setDelegate also starts a termiosThread if delegate responds to -controlFlagsChanged:*+
    +*- (void)setDelegate:(id)object*+
    +* delegate = object ;*+
    +* if ( delegate == nil ) {*+
    +* useTermiosThread = NO ;*+
    +* if ( needsNotification ) {*+
    +* needsNotification = NO ;*+
    +* [ self stopNotification ] ;*+
    +* }*+
    +* }*+
    +* else {*+
    +* if ( [ delegate respondsToSelector:@selector(controlFlagsChanged:) ] ) {*+
    +* useTermiosThread = YES ;*+
    +* [ NSThread detachNewThreadSelector:@selector(termiosThread) toTarget:self withObject:nil ] ;*+
    +* } *+
    +* if ( [ delegate respondsToSelector:@selector(port:added:) ] ) {*+
    +* needsNotification = YES ;*+
    +* [ self startNotification ] ;*+
    +* }*+
    +* }*+
    +*- (id)delegate*+
    +* return delegate ;*+
    @end
    +*// SerialManager.h*+
    +*// K3 Tools*+
    +*// Created by Kok Chen on 4/28/09.*+
    +*// Copyright 2009 Kok Chen, W7AY. All rights reserved.*+
    +*//#import <Cocoa/Cocoa.h>*+
    +*#import <Foundation/Foundation.h>*+
    +*#import <UIKit/UIKit.h>*+
    +*#import <CoreData/CoreData.h>*+
    +*//#import <IOKit/IOKitLib.h>*+
    +*//#import <IOKitLib.h>*+
    +*#include <IOKit/IOKitLib.h>*+
    +*typedef int FileDescriptor ;*+
    +*@interface SerialManager : NSObject {*+
    +* NSLock *termioLock ;*+
    +* FileDescriptor outputfd ;*+
    +* FileDescriptor inputfd ;*+
    +* id delegate ;*+
    +* // serial ports in system*+
    +* NSString *stream[64] ;*+
    +* NSString *path[64] ;*+
    +* int numberOfPorts ;*+
    +* *+
    +* // termios*+
    +* int termiosBits ;*+
    +* Boolean useTermiosThread ;*+
    +* *+
    +* // IO notifications*+
    +* IONotificationPortRef notifyPort ;*+
    +* ioiteratort addIterator, removeIterator ;*+
    +* Boolean needsNotification ;*+
    +*- (void)setDelegate:(id)sender ;*+
    +*- (int)findPorts ;*+
    +*- (int)findModems ;*+
    +*- (int)findRS232Ports ;*+
    +*- (NSString*)streamAtIndex:(int)n ;*+
    +*- (NSString*)pathAtIndex:(int)n ;*+
    +*- (FileDescriptor)openInput:(NSString*)path baudrate:(int)speed bits:(int)bits parity:(int)parity stopbits:(int)stops ;*+
    +*- (FileDescriptor)openInput:(NSString*)path baudrate:(int)speed bits:(int)bits parity:(int)parity stopbits:(int)stops flags:(int)openFlags ;*+
    +*- (FileDescriptor)openOutput:(NSString*)path baudrate:(int)speed bits:(int)bits parity:(int)parity stopbits:(int)stops ;*+
    +*- (FileDescriptor)openOutput:(NSString*)path baudrate:(int)speed bits:(int)bits parity:(int)parity stopbits:(int)stops flags:(int)openFlags ;*+
    +*- (void)closeInput ;*+
    +*- (void)closeOutput ;*+
    +*- (FileDescriptor)inputFileDescriptor ;*+
    +*- (FileDescriptor)outputFileDescriptor ;*+
    +*- (int)getTermios ;*+
    +*- (void)setRTS:(Boolean)state ;*+
    +*- (void)setDTR:(Boolean)state ;*+
    +*- (void)setDelegate:(id)object ;*+
    +*- (id)delegate ;*+
    +*// delegates*+
    +*- (void)port:(NSString*)name added:(Boolean)added ;*+
    +*- (void)controlFlagsChanged:(int)termbits ;*+
    @end
    Could you help me ?

  • Sybase device registration

    Hello,
    we are at the beginning of evaluating the sybase unwired plattform and stuck in the following situation.
    we created a MBO, deployed it to the supserver, generated the iOS code, included it in your app and now trying to connect to the server with the following settings:
    DEVICE:
    ServerName: myServer.local  (the sup is running in a VM)
    ServerPortSetting: 5001
    CompanyIDSetting: 0
    UserNameSetting: supAdmin
    ActivationCodeSettings: 123
    URL Prefix: /tm?cid=%cid%
    SCC- Device Registration:
    Activation user name: supAdmin
    Server name: myServer
    Port: 5001
    FarmID: 0
    Activation Code: 123
    For the connect we use the following code:
    SUPConnectionProfile* cp = [iMAM_IMAMDB getSynchronizationProfile];
         [cp setDomainName:@"default"];
              // Set log level
         [MBOLogger setLogLevel:LOG_INFO];
         if (![iMAM_IMAMDB databaseExists]) {
              [iMAM_IMAMDB createDatabase];
         CallbackHandler* databaseCH = [CallbackHandler newInstance];
         [iMAM_IMAMDB registerCallbackHandler:databaseCH];
         [iMAM_IMAMDB startBackgroundSynchronization];
         NSInteger stat = [SUPMessageClient start];
         if (stat == kSUPMessageClientSuccess) {
              while([SUPMessageClient status] != STATUS_START_CONNECTED){
                   [NSThread sleepForTimeInterval:0.2];
                   NSLog(@"wait for connection to the sup server!");
              [iMAM_IMAMDB beginOnlineLogin:@"supAdmin" password:@"s3pAdmin"];
              while([iMAM_IMAMDB getOnlineLoginStatus].status == SUPLoginPending){
                   [NSThread sleepForTimeInterval:0.2];
                   NSLog(@"wait for connection to the sup server!");
    the problem is, that we are currently not leaving the first while loop, means we do not get a connection to the supserver. In the scc i do not see any incoming requests of my device - "Activation still pending"
    Any clue what causes this strange behaviour?
    Are there any further sybase monitoring capabilities which helps me to get more information about this?
    In general the sybase scc can be reached by the device, which means that that the tcp channel is open.
    We are running on sybase 1.5.5 and iOS 4.2.
    Looking forward to share my experiences with you here.
    Jens

    Hi, try to use same server name in scc (myServer.local).
    The program run on the device or on the simulator? Try to telnet myServer.local on port 5001
    If still not work try this:
    if (result == kSUPMessageClientSuccess) {
              [iMAM_IMAMDB asyncOnlineLogin:@"supAdmin"
    password:@"s3pAdmin"];
              while([databaseCH loginSuccessCount] < 1) {
    [NSThread sleepForTimeInterval:1];
    [window addSubview:navController.view];
    [window makeKeyAndVisible];
    } else
    [self showNoTransportAlert:result];
    Edited by: Alessandro Iannacci on Apr 6, 2011 10:43 AM

  • Changing a mobile users password has no effect

    Hi!
    Changing a mobile account users password on the server doesn't work. On a 10.7.4 server I changed a network user's password, who has a mobile account and was connected to the local network, but he could not log in with either the old or the new password?!?!? I could understand if the change didn't work if the user was off site, but shouldn't this "just work"? I tried both in Server.app and WGM, but still not working. When setting the old password on the server again, it worked!
    Anyone else had this problem? Any solutions. It has happened to 2 users, same story. Clients are 10.6.8 clients.

    Ok, I found out what's wrong.
    To "pan" an image you have to change bounds origin of PARENT view.
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    CGRect viewRect = CGRectMake(50, 50, 100, 100);
    UIView* myView = [self createView:viewRect withColor:[UIColor redColor]];
    UIView* childView = [self createView:CGRectMake(0, 0, 50, 50) withColor:[UIColor blueColor]];
    [myView addSubview:childView];
    [window addSubview:myView];
    myView.clipsToBounds=TRUE;
    myView.bounds=CGRectMake(45, 45, 100, 100);
    [myView release];
    [childView release];
    [window makeKeyAndVisible];
    -(UIView*) createView:(CGRect)viewRect withColor:(UIColor*)color
    UIView* myView = [[UIView alloc] initWithFrame:viewRect];
    myView.backgroundColor=color;
    return myView;
    }

  • A little lost here, view doesn't seem to want to show up

    Hi,
    First of all, let me say that i am not a iPhone or Mac developper although i'm a super good programmer that knows lots of languages (c/c++, java, c#, php, vb, vb.net, etc)
    I was tasked to add a screen to an iphone app that asks for user acceptance of terms and then store the acceptance into the phone. I'm not even at the storage part yet, i'm all lost in that objective C thing... What kind of programming language is that... lol
    Anyway, i tried my best and am able to open a view that was already existant in the system as the application starts. The same view, i duplicated it and renamed all its files, identifiers in the .h and .m file to a new name. I scoured the source code of the app to add the different variables or properties just as the previous view had been added to the app.
    Compile, works, view never shows up... maybe i messed up something, try the older view i tried at first, still works... strange.
    Here is a bit of code:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    [window addSubView:agreementView.view];
    [window makeKeyAndVisible];
    This portion of code doesn't work, but if i change "agreementView" for "hmView" it works fine and shows the view called HmView. The app compiles completly and works in all cases, its just the agreementView that never shows up.
    Can you help me with this at all? Do i need to post anything else. Please keep in mind that i thought it would be super simple to do this and finaly, it's taken me 3h already to simply create a view and recompile the code.

    CDGI Developper wrote:
    this application is already multiview. I'm just trying to add a view in the code that shows an agreement ppl have to accept.
    Ok, understood. It's sounding more and more like a modal view would be the best solution.
    If i use the variable name of another view that was working, it loads up fine as the application starts.
    Although you mentioned creating another view, it seems likely you didn't actually do so, or that the variable you assigned to the new view doesn't actually point to that view. You haven't mentioned Interface Builder yet. IB is the resource editor for Xcode, and is usually where Cocoa developers start when creating a new view (though new views can certainly be created in code without using IB).
    Since you've been focusing on the root view so far (i.e., the view which is added directly to the window in applicationDidFinishLaunching), can we assume that you want the "agreement view" to be reached directly from the root view? Or, do you want agreementView to replace the current root view at start up? For example, do you want agreementView to be the gateway to the app, like a login screen, so that none of the app's functionality can be accessed until the agreement is accepted?
    Once we know exactly how the agreement fits into the view hierarchy, it might be easy to walk you through the steps needed to create it, display it, and dismiss it. Another question that might help clarify your requirements: Could you use an "alert view" instead of a new, full-screen view for your purpose? An instance of the UIAlertView class is used just like a Windows "MessageBox" to display a message and wait for the user to respond. So an alert view would be good for obtaining a "yes" or "no" answer from the user. Of course, if the agreement screen needs to present the text of an agreement, much like the contract presented during an app installation, I guess you'd need a new full-screen view.
    ... if i use the new view i have created (from a copy of the one that works) and i adapt all the identifiers in the different copied files, then the app still compiles, but the reference to the view variable doesn't seem to work.
    Here's an example of how to bring up a modal view that covers the root view at startup:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    // add the root view to the window
    [window addSubview:viewController.view];
    // make a new view controller
    // (this also makes a default view for the new controller)
    UIViewController *myController = [[UIViewController alloc] init];
    myController.view.backgroundColor = [UIColor blueColor];
    // set the modal transition style of the new controller
    myController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    // add a text view object to the new view
    UITextView *myTextView = [[UITextView alloc]
    initWithFrame:CGRectMake(36, 50, 248, 228)];
    myTextView.editable = NO;
    myTextView.showsVerticalScrollIndicator = YES;
    [myController.view addSubview:myTextView];
    [myTextView release];
    // add something legal to the text view
    NSString *legalText = [NSString string];
    for (int i = 0; i < 40; i++)
    legalText = [legalText
    stringByAppendingString:@"Whereas, henceforth and notwithstanding.
    myTextView.text = legalText;
    // add a button to the new view
    UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    myButton.frame = CGRectMake(124, 320, 72, 37);
    [myButton setTitle:@"Agree" forState:UIControlStateNormal];
    [myController.view addSubview:myButton];
    // connect the action of the button to a method in this file
    [myButton addTarget:self action:@selector(dismissAgreement)
    forControlEvents:UIControlEventTouchUpInside];
    // bring up the modal view as a child of the root view
    [viewController presentModalViewController:myController animated:NO];
    [myController release];
    [window makeKeyAndVisible];
    - (IBAction)dismissAgreement {
    [viewController dismissModalViewControllerAnimated:YES];
    To see how the example works, remove the current version of applicationDidFinishLaunching from the app delegate .m file, replace it with the two methods above, save the file and click Build and Go. The example is working, tested code which doesn't require any work in Interface Builder. Be sure to cut and paste directly from the forum to the source file. At this point you don't need to lose a day or two tracking down a syntax error.
    - Ray

  • XCode 4.4.1 crashing

    XCode 4.4.1 is crashing on my 10.8.1 Mountain Lion Build
    I created a small project called "CloudBuilder" and I following along with my standford IPhone Class.
    I actually used all XCode versions ince 3.2 and I appailed that XCode is still crashing.
    Before you Apple FanBoys jump in and ssay it not happening to you, keep in mind I getting XCode crashin on
    every version of XCode I used so its defiantly not an install issue.
    I running on a top of line MacBook Pro 8 GB memory Core i7 with 512 GB SSD so hardwrae is nice.
    YES I have delete the two preferences files and reboot and rerun XCode (same issue)
    This is a bug in XCode pr maybe the IOS SDK.
    It happens whn I in IB and I dragging controls on the view. When I flip between an IBOutlet and an IBAction
    XCode freaks out and crashes sometimes. The bug seems intermediate and I cannot replicate it often,
    I keep closing XCode and delete preference files and rebooting.
    Yes, I installed the command line tools from 10.8.1 and the updated 10.8.1 Core Data library
    Eventually its goes away but will reappear later when my project gets bigger.
    Here the console output
    Anybody else seeing this?
    Date/Time:       2012-07-31 03:15:55.666 -0700
    OS Version:      iPhone OS 5.1.1 (9B206)
    Report Version:  104
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x00000000, 0x00000000
    Crashed Thread:  0
    Last Exception Backtrace:
    0   CoreFoundation                          0x37c1588f __exceptionPreprocess + 163
    1   libobjc.A.dylib                         0x32f46259 objc_exception_throw + 33
    2   CoreFoundation                          0x37c155c5 -[NSException init] + 1
    3   Foundation                              0x36dbf323 _NSSetUsingKeyValueSetter + 131
    4   Foundation                              0x36dbee23 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 231
    5   UIKit                                   0x30bb0965 -[UIView(CALayerDelegate) setValue:forKey:] + 157
    6   Foundation                              0x36d98f09 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 133
    7   CoreFoundation                          0x37b747d3 -[NSObject performSelector:] + 39
    8   CoreFoundation                          0x37b75461 -[NSArray makeObjectsPerformSelector:] + 153
    9   UIKit                                   0x30c660ad -[UINib instantiateWithOwner:options:] + 897
    10  UIKit                                   0x30bd43c7 -[UIViewController _loadViewFromNibNamed:bundle:] + 247
    11  UIKit                                   0x30ab1c59 -[UIViewController loadView] + 89
    12  UIKit                                   0x30a27c17 -[UIViewController view] + 51
    13  UIKit                                   0x30a26461 -[UIWindow addRootViewControllerViewIfPossible] + 45
    14  UIKit                                   0x30a18e87 -[UIWindow _setHidden:forced:] + 295
    15  UIKit                                   0x30a897d5 -[UIWindow makeKeyAndVisible] + 25
    16  UIKit                                   0x30a26e6d -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1633
    17  UIKit                                   0x30a207dd -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 409
    18  UIKit                                   0x309eeac3 -[UIApplication handleEvent:withNewEvent:] + 1011
    19  UIKit                                   0x309ee567 -[UIApplication sendEvent:] + 55
    20  UIKit                                   0x309edf3b _UIApplicationHandleEvent + 5827
    21  GraphicsServices                        0x3604f22b PurpleEventCallback + 883
    22  CoreFoundation                          0x37be9523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 39
    23  CoreFoundation                          0x37be94c5 __CFRunLoopDoSource1 + 141
    24  CoreFoundation                          0x37be8313 __CFRunLoopRun + 1371
    25  CoreFoundation                          0x37b6b4a5 CFRunLoopRunSpecific + 301
    26  CoreFoundation                          0x37b6b36d CFRunLoopRunInMode + 105
    27  UIKit                                   0x30a1f86b -[UIApplication _run] + 551
    28  UIKit                                   0x30a1ccd5 UIApplicationMain + 1081
    29  CloudBuilder                            0x000a9145 main (main.m:16)
    30  CloudBuilder                            0x000a8a3c start + 40
    Thread 0 name:  Dispatch queue: com.apple.main-thread
    Thread 0 Crashed:
    0   libsystem_kernel.dylib                  0x3087632c __pthread_kill + 8
    1   libsystem_c.dylib                       0x32e07208 pthread_kill + 48
    2   libsystem_c.dylib                       0x32e00298 abort + 88
    3   libc++abi.dylib                         0x37290f64 abort_message + 40
    4   libc++abi.dylib                         0x3728e346 default_terminate() + 18
    5   libobjc.A.dylib                         0x32f46350 _objc_terminate + 140
    6   libc++abi.dylib                         0x3728e3be safe_handler_caller(void (*)()) + 70
    7   libc++abi.dylib                         0x3728e44a std::terminate() + 14
    8   libc++abi.dylib                         0x3728f81e __cxa_rethrow + 82
    9   libobjc.A.dylib                         0x32f462a2 objc_exception_rethrow + 6
    10  CoreFoundation                          0x37b6b506 CFRunLoopRunSpecific + 398
    11  CoreFoundation                          0x37b6b366 CFRunLoopRunInMode + 98
    12  UIKit                                   0x30a1f864 -[UIApplication _run] + 544
    13  UIKit                                   0x30a1ccce UIApplicationMain + 1074
    14  CloudBuilder                            0x000a913e main (main.m:16)
    15  CloudBuilder                            0x000a8a34 start + 32
    Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
    Thread 1:
    0   libsystem_kernel.dylib                  0x308663a8 kevent + 24
    1   libdispatch.dylib                       0x34540f04 _dispatch_mgr_invoke + 708
    2   libdispatch.dylib                       0x34540c22 _dispatch_mgr_thread + 30
    Thread 2:
    0   libsystem_kernel.dylib                  0x30876cd4 __workq_kernreturn + 8
    1   libsystem_c.dylib                       0x32dc2f36 _pthread_wqthread + 610
    2   libsystem_c.dylib                       0x32dc2cc8 start_wqthread + 0
    Thread 3:
    0   libsystem_kernel.dylib                  0x30876cd4 __workq_kernreturn + 8
    1   libsystem_c.dylib                       0x32dc2f36 _pthread_wqthread + 610
    2   libsystem_c.dylib                       0x32dc2cc8 start_wqthread + 0
    Thread 4 name:  WebThread
    Thread 4:
    0   libsystem_kernel.dylib                  0x30866004 mach_msg_trap + 20
    1   libsystem_kernel.dylib                  0x308661fa mach_msg + 50
    2   CoreFoundation                          0x37be93ec __CFRunLoopServiceMachPort + 120
    3   CoreFoundation                          0x37be8124 __CFRunLoopRun + 876
    4   CoreFoundation                          0x37b6b49e CFRunLoopRunSpecific + 294
    5   CoreFoundation                          0x37b6b366 CFRunLoopRunInMode + 98
    6   WebCore                                 0x30ff3c9c RunWebThread(void*) + 396
    7   libsystem_c.dylib                       0x32dc872e _pthread_start + 314
    8   libsystem_c.dylib                       0x32dc85e8 thread_start + 0
    Thread 0 crashed with ARM Thread State:
        r0: 0x00000000    r1: 0x00000000      r2: 0x00000001      r3: 0x00000000
        r4: 0x00000006    r5: 0x3e742d98      r6: 0x00000002      r7: 0x2fea59c0
        r8: 0x3f938b30    r9: 0x00000000     r10: 0x3e29542c     r11: 0x00193c50
        ip: 0x00000148    sp: 0x2fea59b4      lr: 0x32e0720f      pc: 0x3087632c
      cpsr: 0x00000010
    Binary Images:
       0xa7000 -    0xa9fff +CloudBuilder armv7  <f9f4e4be658934dda3902ab3474f68bb> /var/mobile/Applications/58867A7E-923D-4D91-B3E7-E030AE3D5A1B/CloudBuilder.app/ CloudBuilder
       0xb2000 -    0xb4fff +libXcodeDebuggerSupport.dylib armv7  <4139c9fae6e832c9ab1eb62e3330e328> /Developer/usr/lib/libXcodeDebuggerSupport.dylib
    0x2fea6000 - 0x2fec7fff  dyld armv7  <77eddfd654df393ba9c95ff01715fd08> /usr/lib/dyld
    0x300f4000 - 0x300f4fff  vecLib armv7  <a2cfe25e77aa36bfb4a30b2d0d2dd465> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vec Lib
    0x301c6000 - 0x3029efff  vImage armv7  <caf3648be2933384b6aa1ae7408ab4f0> /System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vIm age
    0x302cf000 - 0x302d9fff  libvMisc.dylib armv7  <e8248c797b9b363594bb652ddf7ce16d> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/lib vMisc.dylib
    0x303af000 - 0x30670fff  libLAPACK.dylib armv7  <0e94e9a7e7a334649afaccae0f1215a2> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/lib LAPACK.dylib
    0x30682000 - 0x3068afff  MobileWiFi armv7  <b76c3e9fb78234c392058250d4620e72> /System/Library/PrivateFrameworks/MobileWiFi.framework/MobileWiFi
    0x3068d000 - 0x306b2fff  OpenCL armv7  <f4b08361179a3f6bb033415b0d7c6251> /System/Library/PrivateFrameworks/OpenCL.framework/OpenCL
    0x306ff000 - 0x306fffff  libCVMSPluginSupport.dylib armv7  <a80aaa9989483ce3a496a061fd1e9e0a> /System/Library/Frameworks/OpenGLES.framework/libCVMSPluginSupport.dylib
    0x30865000 - 0x3087bfff  libsystem_kernel.dylib armv7  <311f379a9fde305d80c1b22b7dd2e52a> /usr/lib/system/libsystem_kernel.dylib
    0x308c1000 - 0x308d2fff  DataAccessExpress armv7  <e6144ba265da3bb7b9a263aa1a29b054> /System/Library/PrivateFrameworks/DataAccessExpress.framework/DataAccessExpress
    0x308d3000 - 0x30980fff  libxml2.2.dylib armv7  <58d47f064e0232119f4b838ad659f9c1> /usr/lib/libxml2.2.dylib
    0x30981000 - 0x30997fff  EAP8021X armv7  <952fcfdec0633aff923768fca1a26fcb> /System/Library/PrivateFrameworks/EAP8021X.framework/EAP8021X
    0x309eb000 - 0x30e8dfff  UIKit armv7  <cd513a2f22f53d698c3e10f6fe48a63e> /System/Library/Frameworks/UIKit.framework/UIKit
    0x30f0b000 - 0x30f46fff  libCGFreetype.A.dylib armv7  <55941c96cf1f3b048e72a148c4496c16> /System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dyl ib
    0x30f4a000 - 0x31709fff  WebCore armv7  <2690c38c9c5f3c09975d619dd1dfbed7> /System/Library/PrivateFrameworks/WebCore.framework/WebCore
    0x3176e000 - 0x318b7fff  libicucore.A.dylib armv7  <b70646b63f1f3b33896dd8cb91b8dab1> /usr/lib/libicucore.A.dylib
    0x31a73000 - 0x31ac4fff  libstdc++.6.dylib armv7  <c352af5a742e3c7a8d4d7e5f6f454793> /usr/lib/libstdc++.6.dylib
    0x31c0f000 - 0x31c14fff  libcopyfile.dylib armv7  <52e874396c393ed29099789ce702cfe2> /usr/lib/system/libcopyfile.dylib
    0x31e5c000 - 0x31e5ffff  libsystem_network.dylib armv7  <356cb66612e836968ef24e6e5c3364cc> /usr/lib/system/libsystem_network.dylib
    0x31e60000 - 0x31ea5fff  GeoServices armv7  <a26be2e76e8730ab91a16502aba376be> /System/Library/PrivateFrameworks/GeoServices.framework/GeoServices
    0x31ead000 - 0x31eb9fff  CoreVideo armv7  <364fa32d513f3c11b50970120545f1a8> /System/Library/Frameworks/CoreVideo.framework/CoreVideo
    0x31ebc000 - 0x31ef1fff  SystemConfiguration armv7  <4464a4e3bb3f32f7abaa35ebf31fda49> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
    0x31f7c000 - 0x31f7cfff  liblangid.dylib armv7  <644ff4bcfbf337b5b5859e3f0fc0a9a8> /usr/lib/liblangid.dylib
    0x31f7d000 - 0x31f9cfff  libSystem.B.dylib armv7  <0c55744b6f7335eebba4ca2c3d10b43c> /usr/lib/libSystem.B.dylib
    0x321fb000 - 0x321fcfff  libsystem_blocks.dylib armv7  <9fdc27af7350323bbc7d98e14e027907> /usr/lib/system/libsystem_blocks.dylib
    0x321fd000 - 0x32200fff  libcompiler_rt.dylib armv7  <b2c05d8601c13be884097192dca4e187> /usr/lib/system/libcompiler_rt.dylib
    0x32381000 - 0x323b9fff  VideoToolbox armv7  <9f25f38d1cd13a1daff99cfde8884410> /System/Library/PrivateFrameworks/VideoToolbox.framework/VideoToolbox
    0x3287e000 - 0x328c1fff  libcommonCrypto.dylib armv7  <95b49daf4cf038b6bea8010bba3a1e26> /usr/lib/system/libcommonCrypto.dylib
    0x32a6f000 - 0x32a80fff  libxpc.dylib armv7  <ccf25b1e49ce3b2fa58d8c8546755505> /usr/lib/system/libxpc.dylib
    0x32b1c000 - 0x32b20fff  libcache.dylib armv7  <d6a7436ed8dc33d795c9b42baf864882> /usr/lib/system/libcache.dylib
    0x32c7f000 - 0x32c8bfff  libCRFSuite.dylib armv7  <bdb2b4d1a78c39c1ba60d791207aed2a> /usr/lib/libCRFSuite.dylib
    0x32c99000 - 0x32c9cfff  libmacho.dylib armv7  <e52b77623bd031bc807e77029566c777> /usr/lib/system/libmacho.dylib
    0x32d40000 - 0x32db9fff  ProofReader armv7  <6db611d8df6530d480f97a40bc519f70> /System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
    0x32dba000 - 0x32e46fff  libsystem_c.dylib armv7  <f859ce1ad1773f0ba98d7c6e135b7697> /usr/lib/system/libsystem_c.dylib
    0x32e47000 - 0x32e48fff  libdyld.dylib armv7  <977b0ad6f2f433108b4a0324a57cd2ab> /usr/lib/system/libdyld.dylib
    0x32eae000 - 0x32eb2fff  libGFXShared.dylib armv7  <998fccc16cf735dbb62324202995e193> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
    0x32f3d000 - 0x33003fff  libobjc.A.dylib armv7  <90014d1bc583366d85622e43097df416> /usr/lib/libobjc.A.dylib
    0x33004000 - 0x330f5fff  QuartzCore armv7  <35d64a9da5523ae08c9e41511fd3061b> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
    0x330f6000 - 0x330fcfff  liblockdown.dylib armv7  <9e45ce468a6f31e5b8263f2c224aa800> /usr/lib/liblockdown.dylib
    0x3331b000 - 0x3331ffff  libAccessibility.dylib armv7  <9a17d07b5a3b38cfafdf16f78c99b572> /usr/lib/libAccessibility.dylib
    0x333c8000 - 0x333d1fff  libMobileGestalt.dylib armv7  <4a15e845dc6f3a4a980de66c1cc44c42> /usr/lib/libMobileGestalt.dylib
    0x333f1000 - 0x3343bfff  libvDSP.dylib armv7  <441b42aca07b3da39feab25f8349918f> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/lib vDSP.dylib
    0x334b3000 - 0x334b9fff  libnotify.dylib armv7  <9406297de3e43742887890662a87ab53> /usr/lib/system/libnotify.dylib
    0x334be000 - 0x3367bfff  ImageIO armv7  <02e3578171fa3b6a969b244275fd2bab> /System/Library/Frameworks/ImageIO.framework/ImageIO
    0x3377d000 - 0x33796fff  libRIP.A.dylib armv7  <1828cddc5dd93c61afbefb59587d7f8a> /System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
    0x33c47000 - 0x33c9ffff  CoreAudio armv7  <be335e8eb6f93594b028a6ddd503a183> /System/Library/Frameworks/CoreAudio.framework/CoreAudio
    0x33d6d000 - 0x33d7cfff  SpringBoardServices armv7  <a2363f8ed49932dba415d2d4cd32fb74> /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServ ices
    0x33da0000 - 0x33da2fff  MobileInstallation armv7  <215d93dbb0f63cbf828f9126eb7b5349> /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallati on
    0x3420a000 - 0x343eefff  AudioToolbox armv7  <c91e27850452330ea804db6408840fd2> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
    0x343f8000 - 0x344e6fff  libiconv.2.dylib armv7  <2cfefe2ad1d335dd9549562910e7a2e2> /usr/lib/libiconv.2.dylib
    0x344ea000 - 0x344fefff  PersistentConnection armv7  <54091a638f8731cd85ccf00fa06972c3> /System/Library/PrivateFrameworks/PersistentConnection.framework/PersistentConn ection
    0x3453d000 - 0x34553fff  libdispatch.dylib armv7  <9ecfaef4110a3bf9a92d12f0fe8d1d78> /usr/lib/system/libdispatch.dylib
    0x3466a000 - 0x3466bfff  libremovefile.dylib armv7  <402f8956975d3b6fb86ab9b31a43242c> /usr/lib/system/libremovefile.dylib
    0x349a2000 - 0x349c2fff  libxslt.1.dylib armv7  <39348471007e39dab80af68b08390456> /usr/lib/libxslt.1.dylib
    0x34ad9000 - 0x34b58fff  libsqlite3.dylib armv7  <bf01f5ed47b033d8bde30d735ff44416> /usr/lib/libsqlite3.dylib
    0x34b87000 - 0x34b8bfff  AggregateDictionary armv7  <3a3a33f3a05538988c6e2bb363dc46a8> /System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictio nary
    0x34c3b000 - 0x34c58fff  libsystem_info.dylib armv7  <50863bcbf478323e96a8e5b1a83ea6f9> /usr/lib/system/libsystem_info.dylib
    0x34dbc000 - 0x34dbffff  NetworkStatistics armv7  <7848d8ebad99367cb4f7f4e3fe88e5d6> /System/Library/PrivateFrameworks/NetworkStatistics.framework/NetworkStatistics
    0x34e2e000 - 0x34e2efff  libgcc_s.1.dylib armv7  <eb82984fa36c329387aa518aa5205f3d> /usr/lib/libgcc_s.1.dylib
    0x34e4d000 - 0x34e8bfff  IOKit armv7  <fcda71d29d6136dfbd84c1725f4998e5> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x34e8c000 - 0x34e8cfff  libunwind.dylib armv7  <e0a73a57795f3e1698a52ebe6fc07005> /usr/lib/system/libunwind.dylib
    0x3570f000 - 0x35715fff  liblaunch.dylib armv7  <aa2bcba6fc7a36a191958fef2e995475> /usr/lib/system/liblaunch.dylib
    0x35716000 - 0x3574dfff  Security armv7  <eea56f71fde83c2981f9281dc7823725> /System/Library/Frameworks/Security.framework/Security
    0x357be000 - 0x357e1fff  Bom armv7  <c3435ecd2e5839f89de51edad0e1bb00> /System/Library/PrivateFrameworks/Bom.framework/Bom
    0x357e2000 - 0x35806fff  PrintKit armv7  <08509c7bc915358b953de6f5cbef5c56> /System/Library/PrivateFrameworks/PrintKit.framework/PrintKit
    0x35807000 - 0x3584ffff  CoreMedia armv7  <e274e1b894753b2eb05cf7b22a36d0c1> /System/Library/Frameworks/CoreMedia.framework/CoreMedia
    0x35850000 - 0x3589cfff  CoreTelephony armv7  <b8f80d5d594c31d2b5d8fba9fdedb7e1> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
    0x3589d000 - 0x358a1fff  IOMobileFramebuffer armv7  <42dbc26828e934acabb4f3b0a35d8250> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebu ffer
    0x358a5000 - 0x358a9fff  IOSurface armv7  <443ac3aab9283da480dd9dcda3c5c88e> /System/Library/PrivateFrameworks/IOSurface.framework/IOSurface
    0x358e0000 - 0x358e2fff  libCoreVMClient.dylib armv7  <d4d4aa3090c83e87bcb15ed00b93fd5c> /System/Library/Frameworks/OpenGLES.framework/libCoreVMClient.dylib
    0x358e3000 - 0x358e6fff  CaptiveNetwork armv7  <f5cc4b97ce9432da9426f12621453325> /System/Library/PrivateFrameworks/CaptiveNetwork.framework/CaptiveNetwork
    0x35ac4000 - 0x35b0dfff  AddressBook armv7  <b17a2962e9043e0385c3c2c652155f2b> /System/Library/Frameworks/AddressBook.framework/AddressBook
    0x35b11000 - 0x35b1cfff  AccountSettings armv7  <373e59421d983c93931cfbad87b1ae35> /System/Library/PrivateFrameworks/AccountSettings.framework/AccountSettings
    0x35c06000 - 0x35c46fff  libGLImage.dylib armv7  <40448706190031f6b0d9636cc11ee81d> /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
    0x35df9000 - 0x35ed0fff  CFNetwork armv7  <765a472c824830eea91b8f02d12867e4> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
    0x36038000 - 0x36042fff  libbz2.1.0.dylib armv7  <40e4045fb79e382b8833707746cf28b1> /usr/lib/libbz2.1.0.dylib
    0x36043000 - 0x36049fff  MobileKeyBag armv7  <e1f06241ef0e3f0aae00f15df572077e> /System/Library/PrivateFrameworks/MobileKeyBag.framework/MobileKeyBag
    0x3604a000 - 0x36054fff  GraphicsServices armv7  <cb64e146a8ee3fda9e80ffae1ccc9c5a> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
    0x36055000 - 0x3605dfff  ProtocolBuffer armv7  <0e846afacf823d2b8c029cc3010a8253> /System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer
    0x3605e000 - 0x3606dfff  OpenGLES armv7  <e80acc691001301e96101bb89d940033> /System/Library/Frameworks/OpenGLES.framework/OpenGLES
    0x3606e000 - 0x36193fff  JavaScriptCore armv7  <2ffc6c87b94434288366bd53765ee267> /System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore
    0x361c8000 - 0x3670cfff  FaceCoreLight armv7  <f326d88709683520b251dc53cb847c11> /System/Library/PrivateFrameworks/FaceCoreLight.framework/FaceCoreLight
    0x36712000 - 0x36712fff  Accelerate armv7  <55b24cf91a8b3532bde6733c96f14c08> /System/Library/Frameworks/Accelerate.framework/Accelerate
    0x36713000 - 0x36729fff  DictionaryServices armv7  <6ed2e967136f37d4a4b9b318d6c43b83> /System/Library/PrivateFrameworks/DictionaryServices.framework/DictionaryServic es
    0x36aec000 - 0x36aedfff  DataMigration armv7  <d77f0e8f39ee37f5a2ac713a3fd9e693> /System/Library/PrivateFrameworks/DataMigration.framework/DataMigration
    0x36aee000 - 0x36b5efff  CoreImage armv7  <86ac6f5a267637b6b7f8a831dfc7c64b> /System/Library/Frameworks/CoreImage.framework/CoreImage
    0x36bcb000 - 0x36bccfff  libsystem_sandbox.dylib armv7  <6a8f2f33c7543808a0f4599101c3b61a> /usr/lib/system/libsystem_sandbox.dylib
    0x36bcd000 - 0x36bcefff  CoreSurface armv7  <97f871f09f503c98a6371c2b657430d8> /System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface
    0x36ca4000 - 0x36caafff  MobileIcons armv7  <ed1b46f917903c9b9baaa2be4392dafe> /System/Library/PrivateFrameworks/MobileIcons.framework/MobileIcons
    0x36cbb000 - 0x36d04fff  libc++.1.dylib armv7  <5b690e5dd5a43a7fb166ade9fe58a7a4> /usr/lib/libc++.1.dylib
    0x36d33000 - 0x36d84fff  CoreText armv7  <5bfac4ee88d03d5b87a1f105abb7756c> /System/Library/Frameworks/CoreText.framework/CoreText
    0x36d96000 - 0x36f14fff  Foundation armv7  <c40ddb073142315bb4ebb214343d0b7f> /System/Library/Frameworks/Foundation.framework/Foundation
    0x36f15000 - 0x36f2afff  libresolv.9.dylib armv7  <66f7557fa4b43979b186e00271839fdb> /usr/lib/libresolv.9.dylib
    0x37174000 - 0x3721efff  libBLAS.dylib armv7  <bf822cc1a3243ae7b104cf73ca22d352> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/lib BLAS.dylib
    0x3722b000 - 0x3722cfff  libdnsinfo.dylib armv7  <9aede8d6579d3430ac39ae5f95cce498> /usr/lib/system/libdnsinfo.dylib
    0x37273000 - 0x37289fff  libmis.dylib armv7  <258bc92be5823b239b4412dd42cb4807> /usr/lib/libmis.dylib
    0x3728a000 - 0x37291fff  libc++abi.dylib armv7  <bab4dcbfc5943d3fbb637342d35e8045> /usr/lib/libc++abi.dylib
    0x37370000 - 0x373bafff  ManagedConfiguration armv7  <f1fbb825def23043830a095b953a9c94> /System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfigu ration
    0x373bb000 - 0x373befff  CoreTime armv7  <a398de5ba1e43a11b7008e9bb5a7f6fe> /System/Library/PrivateFrameworks/CoreTime.framework/CoreTime
    0x373e3000 - 0x373e3fff  libkeymgr.dylib armv7  <ebd2dddf55d83cf48a18913968775960> /usr/lib/system/libkeymgr.dylib
    0x373e4000 - 0x373f1fff  libbsm.0.dylib armv7  <750a0de73a733019a77144b805d4d2f8> /usr/lib/libbsm.0.dylib
    0x373f4000 - 0x374c4fff  WebKit armv7  <3c5dd2ec46fe3e189c25bba78ad88fa1> /System/Library/PrivateFrameworks/WebKit.framework/WebKit
    0x374c8000 - 0x37504fff  AppSupport armv7  <311eac85b2a433a884dacba77217b49e> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
    0x37505000 - 0x3750cfff  AssetsLibraryServices armv7  <38132ecfd74b325fb1a4142bab663c19> /System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibrary Services
    0x3752a000 - 0x3752ffff  libsystem_dnssd.dylib armv7  <27bb5462450732e380f5a2c170546e93> /usr/lib/system/libsystem_dnssd.dylib
    0x37987000 - 0x37accfff  CoreGraphics armv7  <903545b89a7f311d95100ac7d1d44709> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
    0x37acd000 - 0x37ad9fff  libz.1.dylib armv7  <36ce86a3dc8c344596c8c325615f374b> /usr/lib/libz.1.dylib
    0x37b5c000 - 0x37c73fff  CoreFoundation armv7  <6d450fe923d7387f8b01845e0edd713d> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    0x37c93000 - 0x37ce1fff  CoreLocation armv7  <44550ebedf23334d85441d9743b74e03> /System/Library/Frameworks/CoreLocation.framework/CoreLocation
    0x37d07000 - 0x37d16fff  GenerationalStorage armv7  <d84c3fd0e7bd36e78c256f2f4c5a4e91> /System/Library/PrivateFrameworks/GenerationalStorage.framework/GenerationalSto rage
    0x37d17000 - 0x37d5bfff  MobileCoreServices armv7  <757226927a873d5492be721908077b48> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices

    Tony - Also experiencing the same issue - (also filed under devforums and TSI raised too!) - See content that follows.. I narrowed down the issue to do with CloudStorage (NSUbiquitousKeyValueStore)
    Guys,
    I seriously think this is a new issue occuring after the update of 10.8.1 (MacBookPro Retina) with XCode 4.4.1
    So here goes...
            _ubiquity = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
            _defaults = [NSUserDefaults standardUserDefaults];
            // if ubiquity is available - use it !
            if (_ubiquity) {
                _cloudStore = [NSUbiquitousKeyValueStore defaultStore];
                [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(storeDidChange:) name:NSUbiquitousKeyValueStoreDidChangeExternallyNotificationobject:_cloudStore ];
                [_cloudStore synchronize];
    Later on in the code (someplace else)....
        - (void) setDateOfBirth:(NSDate *)dateOfBirth
            if (self.isCloudEnabled) {
                [_cloudStore setObject:dateOfBirth forKey:@"dateOfBirth"];
            } else {
                [_defaults setObject:dateOfBirth forKey:@"dateOfBirth"];
                [_defaults synchronize];
    (_defaults is a NSUserDefaults object FYI - see above code seg)...
    So when the line (_cloudStore setObject...) occurs, 4 seconds later i receive a crash....
    Aug 23 19:49:04 Sams-MBPr.local filecoordinationd[172]: NSFileCoordinator only handles URLs that use the file: scheme. This one does not:
    x-xcode-log://217822E6-14E4-4004-B9A0-D07C7A613B48
    Per debugger in xcode...
    libxpc.dylib`xpc_get_type:
    0x373dc10c:  ldr    r0, [r0, #4]
    0x373dc10e:  bx     lr
    With the iPhone connected (disconnected from the machine), the error occurs again, and the crashlog shows the following...
    Incident Identifier: DF93D111-C075-4EB0-8287-9EC1964EA7A0
    CrashReporter Key:   c70aa078615a40b5afc89a9d7dc1c8966fb3d753
    Hardware Model:      iPhone3,1
    Process:         gocial [1083]
    Path:            /var/mobile/Applications/4796306D-B310-4EF6-81CD-B9EFE7F40287/gocial.app/gocial
    Identifier:      gocial
    Version:         ??? (???)
    Code Type:       ARM (Native)
    Parent Process:  launchd [1]
    Date/Time:       2012-08-23 20:10:14.967 +0200
    OS Version:      iPhone OS 5.1.1 (9B208)
    Report Version:  104
    Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x00000004
    Crashed Thread:  0
    Thread 0 name:  Dispatch queue: com.apple.ubkvstore
    Thread 0 Crashed:
    0   libxpc.dylib                  0x373dc10c xpc_get_type + 0
    1   libxpc.dylib                  0x373dd7da xpc_connection_send_message_with_reply_sync + 14
    2   SyncedDefaults                0x33393f84 -[SYDClient _sendMessageWithReplySync:] + 236
    3   SyncedDefaults                0x33393c7a -[SYDClient sendMessageWithName:userInfo:] + 38
    4   SyncedDefaults                0x333956f4 -[SYDRemotePreferencesSource synchronizeForced:] + 672
    5   Foundation                    0x3296caa0 __66-[NSUbiquitousKeyValueStore _synchronizeForced:notificationQueue:]_block_invoke_0 + 124
    6   libdispatch.dylib             0x376d0790 _dispatch_barrier_sync_f_invoke + 16
    7   libdispatch.dylib             0x376d0604 dispatch_barrier_sync_f$VARIANT$up + 56
    8   libdispatch.dylib             0x376d0238 dispatch_sync_f$VARIANT$up + 12
    9   libdispatch.dylib             0x376d08b6 dispatch_sync$VARIANT$up + 26
    10  Foundation                    0x3286a05a -[NSUbiquitousKeyValueStore _synchronizeForced:notificationQueue:] + 314
    11  Foundation                    0x32869f18 -[NSUbiquitousKeyValueStore _synchronizeForced:] + 16
    12  Foundation                    0x3296c50c -[NSUbiquitousKeyValueStore _syncConcurrently] + 144
    13  Foundation                    0x328db606 __NSFireTimer + 138
    14  CoreFoundation                0x36c72a2c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
    15  CoreFoundation                0x36c72692 __CFRunLoopDoTimer + 358
    16  CoreFoundation                0x36c71268 __CFRunLoopRun + 1200
    17  CoreFoundation                0x36bf449e CFRunLoopRunSpecific + 294
    18  CoreFoundation                0x36bf4366 CFRunLoopRunInMode + 98
    19  GraphicsServices              0x34dbb432 GSEventRunModal + 130
    20  UIKit                         0x34e9dcce UIApplicationMain + 1074
    21  gocial                        0x0003b7b6 main (main.m:16)
    22  gocial                        0x0003b750 start + 32
    Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager 
    Thread 1:
    0   libsystem_kernel.dylib        0x368a43a8 kevent + 24
    1   libdispatch.dylib             0x376d1ea4 _dispatch_mgr_invoke + 708
    2   libdispatch.dylib             0x376d1bc2 _dispatch_mgr_thread + 30
    Thread 2:
    0   libsystem_kernel.dylib        0x368b4cd4 __workq_kernreturn + 8
    1   libsystem_c.dylib             0x331e6f36 _pthread_wqthread + 610
    2   libsystem_c.dylib             0x331e6cc8 start_wqthread + 0
    Thread 3:
    0   libsystem_kernel.dylib        0x368b4cd4 __workq_kernreturn + 8
    1   libsystem_c.dylib             0x331e6f36 _pthread_wqthread + 610
    2   libsystem_c.dylib             0x331e6cc8 start_wqthread + 0
    Thread 4 name:  WebThread
    Thread 4:
    0   libsystem_kernel.dylib        0x368a4004 mach_msg_trap + 20
    1   libsystem_kernel.dylib        0x368a41fa mach_msg + 50
    2   CoreFoundation                0x36c723ec __CFRunLoopServiceMachPort + 120
    3   CoreFoundation                0x36c71124 __CFRunLoopRun + 876
    4   CoreFoundation                0x36bf449e CFRunLoopRunSpecific + 294
    5   CoreFoundation                0x36bf4366 CFRunLoopRunInMode + 98
    6   WebCore                       0x31be7c9c RunWebThread(void*) + 396
    7   libsystem_c.dylib             0x331ec72e _pthread_start + 314
    8   libsystem_c.dylib             0x331ec5e8 thread_start + 0
    Thread 5:
    0   libsystem_kernel.dylib        0x368b4cd4 __workq_kernreturn + 8
    1   libsystem_c.dylib             0x331e6f36 _pthread_wqthread + 610
    2   libsystem_c.dylib             0x331e6cc8 start_wqthread + 0
    Thread 6 name:  com.apple.NSURLConnectionLoader
    Thread 6:
    0   libsystem_kernel.dylib        0x368a4004 mach_msg_trap + 20
    1   libsystem_kernel.dylib        0x368a41fa mach_msg + 50
    2   CoreFoundation                0x36c723ec __CFRunLoopServiceMachPort + 120
    3   CoreFoundation                0x36c71124 __CFRunLoopRun + 876
    4   CoreFoundation                0x36bf449e CFRunLoopRunSpecific + 294
    5   CoreFoundation                0x36bf4366 CFRunLoopRunInMode + 98
    6   Foundation                    0x32846bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
    7   Foundation                    0x32846a7a -[NSThread main] + 66
    8   Foundation                    0x328da58a __NSThread__main__ + 1042
    9   libsystem_c.dylib             0x331ec72e _pthread_start + 314
    10  libsystem_c.dylib             0x331ec5e8 thread_start + 0
    Thread 7 name:  com.apple.CFSocket.private
    Thread 7:
    0   libsystem_kernel.dylib        0x368b4570 __select + 20
    1   CoreFoundation                0x36c7663a __CFSocketManager + 726
    2   libsystem_c.dylib             0x331ec72e _pthread_start + 314
    3   libsystem_c.dylib             0x331ec5e8 thread_start + 0
    Thread 0 crashed with ARM Thread State:
        r0: 0x00000000    r1: 0x00000000      r2: 0x00000001      r3: 0x00000000
        r4: 0x00000000    r5: 0x00264aa0      r6: 0x3f665380      r7: 0x2fe36ae0
        r8: 0x3fa99670    r9: 0x0026f320     r10: 0x00000000     r11: 0x37fb38df
        ip: 0x3eede1c0    sp: 0x2fe36a9c      lr: 0x373dd7e1      pc: 0x373dc10c
      cpsr: 0x80000030
    Notice the first lines (libxpc)....
    Appreciate any help - 10 minutes before updating my MBPr, everything was working fine - Now im royally f**....
    Have escalated this to TSI and awaiting a response. If anyone has advice, please feel free to reach out at sam.colak at me dot com.
    Thanks in advance,
    Samuel

  • We found that your app crashed on iPad (3rd Generation) running iOS 6.1.3, which is not in compliance with the App Store Review Guidelines  Incident Identifier: 82F7326A-CBB9-4C0D-BB47-602E677FFACD CrashReporter Key:   f007efd015d54832edfad6b6f673eb18289b

    Incident Identifier: 82F7326A-CBB9-4C0D-BB47-602E677FFACD
    CrashReporter Key:   f007efd015d54832edfad6b6f673eb18289bfde9
    Hardware Model:      xxx
    Process:         myAutoNote [3514]
    Path:            /var/mobile/Applications/EC26F60E-15B2-49A0-8594-8D2934F070B6/myAutoNote.app/my AutoNote
    Identifier:      myAutoNote
    Version:         ??? (???)
    Code Type:       ARM (Native)
    Parent Process:  launchd [1]
    Date/Time:       2013-03-27 10:44:05.268 -0700
    OS Version:      iOS 6.1 (10B141)
    Report Version:  104
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Crashed Thread:  0
    Last Exception Backtrace:
    (0x3248229e 0x3a31b97a 0x323cc8d4 0x342eefd8 0x342f09b6 0x7dbec 0x342a9468 0x7df82 0x342a0e94 0x3435814a 0x7df64 0x3481f888 0x3481f548 0x7daa6 0x80de8 0x342eaad4 0x342ea65e 0x342e2846 0x3428ac34 0x3428a6c8 0x3428a116 0x35f7c59e 0x35f7c1ce 0x3245716e 0x32457112 0x32455f94 0x323c8eb8 0x323c8d44 0x342e1480 0x342de2fc 0x804fa 0x7c6fc)
    Thread 0 name:  Dispatch queue: com.apple.main-thread
    Thread 0 Crashed:
    0   libsystem_kernel.dylib                  0x3a819350 __pthread_kill + 8
    1   libsystem_c.dylib                       0x3a79011e pthread_kill + 54
    2   libsystem_c.dylib                       0x3a7cc96e abort + 90
    3   libc++abi.dylib                         0x39d6ad4a abort_message + 70
    4   libc++abi.dylib                         0x39d67ff4 default_terminate() + 20
    5   libobjc.A.dylib                         0x3a31ba74 _objc_terminate() + 144
    6   libc++abi.dylib                         0x39d68078 safe_handler_caller(void (*)()) + 76
    7   libc++abi.dylib                         0x39d68110 std::terminate() + 16
    8   libc++abi.dylib                         0x39d69594 __cxa_rethrow + 84
    9   libobjc.A.dylib                         0x3a31b9cc objc_exception_rethrow + 8
    10  CoreFoundation                          0x323c8f1c CFRunLoopRunSpecific + 452
    11  CoreFoundation                          0x323c8d44 CFRunLoopRunInMode + 100
    12  UIKit                                   0x342e1480 -[UIApplication _run] + 664
    13  UIKit                                   0x342de2fc UIApplicationMain + 1116
    14  myAutoNote                              0x000804fa 0x7a000 + 25850
    15  myAutoNote                              0x0007c6fc 0x7a000 + 9980
    Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
    Thread 1:
    0   libsystem_kernel.dylib                  0x3a809648 kevent64 + 24
    1   libdispatch.dylib                       0x3a739974 _dispatch_mgr_invoke + 792
    2   libdispatch.dylib                       0x3a739654 _dispatch_mgr_thread$VARIANT$mp + 32
    Thread 2:
    0   libsystem_kernel.dylib                  0x3a819d98 __workq_kernreturn + 8
    1   libsystem_c.dylib                       0x3a767cf6 _pthread_workq_return + 14
    2   libsystem_c.dylib                       0x3a767a12 _pthread_wqthread + 362
    3   libsystem_c.dylib                       0x3a7678a0 start_wqthread + 4
    Thread 3:
    0   libsystem_kernel.dylib                  0x3a819d98 __workq_kernreturn + 8
    1   libsystem_c.dylib                       0x3a767cf6 _pthread_workq_return + 14
    2   libsystem_c.dylib                       0x3a767a12 _pthread_wqthread + 362
    3   libsystem_c.dylib                       0x3a7678a0 start_wqthread + 4
    Thread 4 name:  WebThread
    Thread 4:
    0   libsystem_kernel.dylib                  0x3a808eb4 mach_msg_trap + 20
    1   libsystem_kernel.dylib                  0x3a809048 mach_msg + 36
    2   CoreFoundation                          0x32457040 __CFRunLoopServiceMachPort + 124
    3   CoreFoundation                          0x32455d9e __CFRunLoopRun + 878
    4   CoreFoundation                          0x323c8eb8 CFRunLoopRunSpecific + 352
    5   CoreFoundation                          0x323c8d44 CFRunLoopRunInMode + 100
    6   WebCore                                 0x383ae500 RunWebThread(void*) + 440
    7   libsystem_c.dylib                       0x3a77230e _pthread_start + 306
    8   libsystem_c.dylib                       0x3a7721d4 thread_start + 4
    Thread 0 crashed with ARM Thread State (32-bit):
        r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x3c30d534
        r4: 0x00000006    r5: 0x3c30db88      r6: 0x1e563394      r7: 0x2fd86a14
        r8: 0x1e563370    r9: 0x00000300     r10: 0x00000001     r11: 0x00000000
        ip: 0x00000148    sp: 0x2fd86a08      lr: 0x3a790123      pc: 0x3a819350
      cpsr: 0x00000010
    any help whats happening?
    In my app delegate
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
        [[UIApplication sharedApplication] registerForRemoteNotificationTypesUIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
      // Set these variables before launching the app
        NSString* appKey = @"xxxxxxxxx";
              NSString* appSecret = @"xxxxxxxxx";
    NSString *root = kDBRootAppFolder; // Should be set to either kDBRootAppFolder or kDBRootDropbox
              NSString* errorMsg = nil;
    if ([appKey rangeOfCharacterFromSet:[[NSCharacterSet alphanumericCharacterSet] invertedSet]].location != NSNotFound) {
                        errorMsg = @"Make sure you set the app key correctly in AppDelegate.m";
              } else if ([appSecret rangeOfCharacterFromSet:[[NSCharacterSet alphanumericCharacterSet] invertedSet]].location != NSNotFound) {
                        errorMsg = @"Make sure you set the app secret correctly in AppDelegate.m";
              } else if ([root length] == 0) {
                        errorMsg = @"Set your root to use either App Folder of full Dropbox";
              } else {
      NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"iAutoMobile" ofType:@"sqlite"];
                        NSData *plistData = [NSData dataWithContentsOfFile:plistPath];
                        NSDictionary *loadedPlist =
            [NSPropertyListSerialization
            propertyListFromData:plistData mutabilityOption:0 format:NULL errorDescription:NULL];
      NSString *scheme = [[[[loadedPlist objectForKey:@"CFBundleURLTypes"] objectAtIndex:0] objectForKey:@"CFBundleURLSchemes"] objectAtIndex:0];
                        if ([scheme isEqual:@"db-APP_KEY"]) {
                                  errorMsg = @"Set your URL scheme correctly in DBRoulette-Info.plist";
                   DBSession* session =  [[DBSession alloc] initWithAppKey:appKey appSecret:appSecret root:root];
                   session.delegate = self; // DBSessionDelegate methods allow you to handle re-authenticating
                   [DBSession setSharedSession:session];
                   [DBRequest setNetworkRequestDelegate:self];
                   if (errorMsg != nil) {
                             [[[UIAlertView alloc]
                                initWithTitle:@"Error Configuring Session" message:errorMsg
                                delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]
                              show];
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        NSString *password1 = @"xxxxxxxxx";
        NSString *udid =[[NSUserDefaults standardUserDefaults]  objectForKey:@"device_token"];
        NSString *str = [NSString stringWithFormat:@"%@%@",udid,password1];
        NSString *key =[UtilityClass sha1:str]; //[self base64forData:data];
        NSError *error = nil;
        NSString *password = [SFHFKeychainUtils getPasswordForUsername:key andServiceName:kStoredData error:&error];
        if ([password isEqualToString:@"Purchased"])
            self.viewControllerObj = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
            //self.viewControllerObj = [[ViewController alloc] init];
            self.nav = [[UINavigationController alloc] initWithRootViewController:viewControllerObj];
            [window addSubview:[nav view]];
            //[nav release];
        } else
            self.viewControllerObj = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
            self.nav = [[UINavigationController alloc] initWithRootViewController:viewControllerObj];
            _bannerViewController = [[BannerViewController alloc] initWithContentViewController:nav];
            self.window.rootViewController = _bannerViewController;
        [self.window makeKeyAndVisible];
        NSURL *launchURL = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
              NSInteger majorVersion =
        [[[[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@"."] objectAtIndex:0] integerValue];
              if (launchURL && majorVersion < 4) {
      // Pre-iOS 4.0 won't call application:handleOpenURL; this code is only needed if you support
      // iOS versions 3.2 or below
                        [self application:application handleOpenURL:launchURL];
      return NO;
        return YES;

    That crash log is useless unless it is symbolicated.

  • [iPhone] Getting non-Nib simple app to work

    Dear Experts,
    I'm having trouble getting a trivial application with no Nib file to work.
    One key thing is the need to pass the name of the AppDelegate class as the last parameter to UIApplicationMain(). Yet it still doesn't do anything. Here's the code:
    main.m:
    #import <UIKit/UIKit.h>
    int main(int argc, char *argv[])
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, @"HelloWorldAppDelegate");
    [pool release];
    return retVal;
    HelloWorldAppDelegate.h:
    #import <UIKit/UIKit.h>
    @interface HelloWorldAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow* window;
    @end
    HelloWorldAppDelegate.m:
    #import "HelloWorldAppDelegate.h"
    @implementation HelloWorldAppDelegate
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    window.backgroundColor = [UIColor whiteColor];
    [window makeKeyAndVisible];
    - (void)dealloc {
    [window release];
    [super dealloc];
    @end
    All that that should do is create a window with a white background. When I run it in the simulator I just see a blank black background. Attempts to add other content as subviews of the window also result in nothing being visible.
    I think that I must be missing some other bit of fundamental "plumbing" somewhere that would have been done for me my the nib file in a project that had one. Does anyone have any clues? Can anyone point me to some sample code that doesn't use a nib file? According to the debugger, my applicationDidFinishLaunching is being run.
    Thanks in advance!
    Phil.

    Thanks for the hint; here's the code again:
    main.m:
    #import <UIKit/UIKit.h>
    int main(int argc, char *argv[])
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, @"HelloWorldAppDelegate");
    [pool release];
    return retVal;
    HelloWorldAppDelegate.h:
    #import <UIKit/UIKit.h>
    @interface HelloWorldAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow* window;
    @end
    HelloWorldAppDelegate.m
    #import "HelloWorldAppDelegate.h"
    @implementation HelloWorldAppDelegate
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    window.backgroundColor = [UIColor whiteColor];
    [window makeKeyAndVisible];
    - (void)dealloc {
    [window release];
    [super dealloc];
    @end

  • [iPhone] UIImageView in UIScrollView

    Ok, this is something that's been hanging in my code for a while and I just can't get it to work. I just need my UIImageView to get centered in a UIScrollView and zoom working properly. The Problem is the centering, either you set the Frame of your UIImageView to the size of your UIScrollView and the frame being too large the edge of the image bounces off the image, or you set the UIImageView to the frame of the enclosing UIImage but then the UIImageView is placed on the top of the UIScrollView's coordinates. I've tried with .center .contentSize .contentOffSet/inset, the most promizing beeing UIImageView.center = UIScrollView.center. The problem is after the zoom the height of the contentSize of the UIScrollView is plain wrong, exceeding the new size of the UIImageView. I've set an xcode project covering this topic at http://public.me.com/michaf
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    UIImage* image = [[UIImage alloc]initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Vespa" ofType:@"jpg"]];
    imageView = [[UIImageView alloc]initWithImage:image];
    imageView.frame = [[UIScreen mainScreen] bounds];
    imageView.contentMode = (UIViewContentModeScaleAspectFit);
    imageView.autoresizingMask = ( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
    imageView.backgroundColor = [UIColor blackColor];
    window.backgroundColor = [UIColor blackColor];
    // I'm setting the UIImageView size so it fills the screen first
    float ratio = image.size.width/[[UIScreen mainScreen] bounds].size.width;
    CGRect imageFrame = CGRectMake(0,0, [[UIScreen mainScreen] bounds].size.width, (image.size.height/ratio));
    imageView.frame = imageFrame;
    UIScrollView* scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
    scrollView.contentMode = (UIViewContentModeScaleAspectFit);
    scrollView.autoresizingMask = ( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
    scrollView.maximumZoomScale = 2.5;
    scrollView.minimumZoomScale = 1;
    scrollView.clipsToBounds = YES;
    scrollView.delegate = self;
    [scrollView addSubview:imageView];
    //imageView.center = scrollView.center; This is one of my many attempts, try this, the actual size of the scrollView's content view after the zoom gets a wrong height
    [image release];
    [imageView release];
    [window addSubview:scrollView];
    [window makeKeyAndVisible];
    - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
    return imageView;

    Adding these code seems help, but I don't know which is the right place to put these codes.
    scrollView.frame = self.view.bounds;
    scrollView.contentSize = self.imageview.bounds.size;
    [scrollView setNeedsDisplay];
    BR,
    Edward Yang

  • Error I don't know how to fix myMessage.text

    Hi,
    I am getting an error on the below piece of code, the error is showing on the myMessage.text:@"hello xcode";
    can anyone see where I'm going wrong?, I am following a self teach manual. Thanks in advace.
    UILabel *myMessage;
       myMessage=[[UILabel alloc]  
                  initWithFrame:CGRectMake(25.0, 225.0, 300.0, 50.0)
                  myMessage.text:@"hello xcode";
        myMessage.font=[UIFont systemFontOfSize:48];
        [_window addSubview:myMessage];
        [_window makeKeyAndVisible];
        return YES;

    I have no errors now but am getting a white screen on the simulator, can anyone help out?
    UILabel *myMessage;
        myMessage=[[UILabel alloc]  initWithFrame:CGRectMake(25.0, 225.0, 300.0, 50.0)];
        myMessage.text=@"Hello Xcode";
        myMessage.font=[UIFont systemFontOfSize:48];
        [_window addSubview:myMessage];
        [myMessage release];
        [_window makeKeyAndVisible];
    return YES;

Maybe you are looking for

  • Is InDesign CS4 compatible with Office for Mac 2011?

    Having trouble importing copy from 2011 Word docs to InDesign. Very small business cant justify updating from ID CS4. Just updated to Office for Mac 2011, however, and am now having trouble placing text into InDesign. Should I remove 2011 and go back

  • Upload files box in form on CS6

    I'm a student learning Dreamweaver and I am creating a form on a page to upload files or (attach files) but I can't find a way to create the box. I do have a server to post to if that matters. My current form code looks like this <form name="form1" m

  • Vlan config issues

    I have a 6509 with a vlan 105 configure. I have also added a vlan 100. vlan 100 and 105 work for internal routing. vlan 105 workstation can get to the internet. however any vlan 100 workstation can not access the internet. A tracert from a workstatio

  • Naming a MovieClip from FlashVars

    I have a Flash file containing a floor plan over my office. I want visitors to be able to locate the room for a specific person by clicking on the room nr. In my HTML-code I give the FlashVars a value equal to the chosen person's room number like thi

  • Problem sending command

    I keep getting the error "There was a problem sending the command to the program"