Search Results

Search found 10 results on 1 pages for 'munchine'.

Page 1/1 | 1 

  • A valid provisioning profile for this executable was not found

    - by munchine
    I'm trying to debug my first app on the device and got this error message, A valid provisioning profile for this executable was not found. I've gone thru the Apple manuals, checked SO and other sites but cannot work out what I've done wrong? This is what I've done so far. Got my provisioning profile. I check Organizer and it's there, plus it shows that it is installed on my iPhone (green button). My profile is in ~/library/MobileDevice/Provisioning Profiles My certificate is in Keychain Access In Xcode I have have the Project Info showing the Entitlements correctly. The Code Signing Identity matches what's in Keychain. I've set the Target Info to be the same as Project Info. Have I done something inconsistently?

    Read the article

  • Setting background views depending on user settings

    - by munchine
    I've got an app where the background needs to be set depending on user preference. The user can change this at any time via settings tab. I've got it working by checking NSUserDefaults in viewWillAppear and setting self.view.backgroundColor. This is really clunky. The right approach (I thought) is to set the background in the root view and for every views that gets on the stack inherit the background. So in viewDidLoad, I've got self.view.backgroundColor = [UIColor clearColor]; I would have thought this should work. But all I get is a clear background. Any guidance is greatly appreciated.

    Read the article

  • selectedSegmentIndex not updating UISegmentControl

    - by munchine
    In my viewDidLoad, I'm retrieving user preferences and updating the settings tab. It is working for editSelection (see code) but the other NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; BOOL editSelection = [userDefaults boolForKey:@"editToggleSwitch"]; editingToggle.selectedSegmentIndex = editSelection; // this is working! bToggle.selectedSegmentIndex = [[userDefaults objectForKey:@"bSegment"] intValue]; In the view, the editingToggle segment is displaying correctly but bToggle is always at 0? NSLog shows that the data was saved and retrieved correctly. I've even set bToggle.selectedSegmentIndex = 1; but it still does not reflect correctly in the view? Any ideas?

    Read the article

  • Distance between Long Lat coord using SQLITE

    - by munchine
    I've got an sqlite db with long and lat of shops and I want to find out the closest 5 shops. So the following code works fine. if(sqlite3_prepare_v2(db, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { while (sqlite3_step(compiledStatement) == SQLITE_ROW) { NSString *branchStr = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)]; NSNumber *fLat = [NSNumber numberWithFloat:(float)sqlite3_column_double(compiledStatement, 1)]; NSNumber *fLong = [NSNumber numberWithFloat:(float)sqlite3_column_double(compiledStatement, 2)]; NSLog(@"Address %@, Lat = %@, Long = %@", branchStr, fLat, fLong); CLLocation *location1 = [[CLLocation alloc] initWithLatitude:currentLocation.coordinate.latitude longitude:currentLocation.coordinate.longitude]; CLLocation *location2 = [[CLLocation alloc] initWithLatitude:[fLat floatValue] longitude:[fLong floatValue]]; NSLog(@"Distance i meters: %f", [location1 getDistanceFrom:location2]); [location1 release]; [location2 release]; } } I know the distance from where I am to each shop. My question is. Is it better to put the distance back into the sqlite row, I have the row when I step thru the database. How do I do that? Do I use the UPDATE statement? Does someone have a piece of code to help me. I can read the sqlite into an array and then sort the array. Do you recommend this over the above approach? Is this more efficient? Finally, if someone has a better way to get the closest 5 shops, love to hear it.

    Read the article

  • AVAudioPlayer crash after playing from an AVAudioRecorder

    - by munchine
    I've got a button the user tap to start recording and tap again to stop. When it stop I want the recorded voice 'echo' back so the user can hear what was recorded. This works fine the first time. If I hit the button for the third time, it starts a new recording and when I hit stop it crashes with EXC_BAD_ACCESS. - (IBAction) readToMeTapped { if(recording) { recording = NO; [readToMeButton setTitle:@"Stop Recording" forState: UIControlStateNormal ]; NSMutableDictionary *recordSetting = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithFloat: 44100.0], AVSampleRateKey, [NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey, [NSNumber numberWithInt: 1], AVNumberOfChannelsKey, [NSNumber numberWithInt: AVAudioQualityMax], AVEncoderAudioQualityKey, nil]; // Create a new dated file NSDate *now = [NSDate dateWithTimeIntervalSinceNow:0]; NSString *caldate = [now description]; recordedTmpFile = [NSURL fileURLWithPath:[[NSString stringWithFormat:@"%@/%@.caf", DOCUMENTS_FOLDER, caldate] retain]]; error = nil; recorder = [[ AVAudioRecorder alloc] initWithURL:recordedTmpFile settings:recordSetting error:&error]; [recordSetting release]; if(!recorder){ NSLog(@"recorder: %@ %d %@", [error domain], [error code], [[error userInfo] description]); UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Warning" message: [error localizedDescription] delegate: nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; return; } NSLog(@"Using File called: %@",recordedTmpFile); //Setup the recorder to use this file and record to it. [recorder setDelegate:self]; [recorder prepareToRecord]; [recorder recordForDuration:(NSTimeInterval) 5]; //recording for a limited time } else { // it crashes the second time it gets here! recording = YES; NSLog(@"Recording YES Using File called: %@",recordedTmpFile); [readToMeButton setTitle:@"Start Recording" forState:UIControlStateNormal ]; [recorder stop]; //Stop the recorder. //playback recording AVAudioPlayer * newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:recordedTmpFile error:&error]; [recordedTmpFile release]; self.aPlayer = newPlayer; [newPlayer release]; [aPlayer setDelegate:self]; [aPlayer prepareToPlay]; [aPlayer play]; } } - (void)audioRecorderDidFinishRecording:(AVAudioRecorder *)sender successfully:(BOOL)flag { NSLog (@"audioRecorderDidFinishRecording:successfully:"); [recorder release]; recorder = nil; } Checking the debugger, it flags the error here @synthesize aPlayer, recorder; This is the part I don't understand. I thought it may have something to do with releasing memory but I've been careful. Have I missed something?

    Read the article

  • AVAudioPlayer crash after playing from an AVAudioRecord

    - by munchine
    I've got a button the user tap to start recording and tap again to stop. When it stop I want the recorded voice 'echo' back so the user can hear what was recorded. This works fine the first time. If I hit the button for the third time, it starts a new recording and when I hit stop it crashes with EXC_BAD_ACCESS. - (IBAction) readToMeTapped { if(recording) { recording = NO; [readToMeButton setTitle:@"Stop Recording" forState: UIControlStateNormal ]; NSMutableDictionary *recordSetting = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithFloat: 44100.0], AVSampleRateKey, [NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey, [NSNumber numberWithInt: 1], AVNumberOfChannelsKey, [NSNumber numberWithInt: AVAudioQualityMax], AVEncoderAudioQualityKey, nil]; // Create a new dated file NSDate *now = [NSDate dateWithTimeIntervalSinceNow:0]; NSString *caldate = [now description]; recordedTmpFile = [NSURL fileURLWithPath:[[NSString stringWithFormat:@"%@/%@.caf", DOCUMENTS_FOLDER, caldate] retain]]; error = nil; recorder = [[ AVAudioRecorder alloc] initWithURL:recordedTmpFile settings:recordSetting error:&error]; if(!recorder){ NSLog(@"recorder: %@ %d %@", [error domain], [error code], [[error userInfo] description]); UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Warning" message: [error localizedDescription] delegate: nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; return; } NSLog(@"Using File called: %@",recordedTmpFile); //Setup the recorder to use this file and record to it. [recorder setDelegate:self]; [recorder prepareToRecord]; [recorder recordForDuration:(NSTimeInterval) 5]; //recording for a limited time } else { // it crashes the second time it gets here! recording = YES; NSLog(@"Recording YES Using File called: %@",recordedTmpFile); [readToMeButton setTitle:@"Start Recording" forState:UIControlStateNormal ]; [recorder stop]; //Stop the recorder. //playback recording AVAudioPlayer * newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:recordedTmpFile error:&error]; [recordedTmpFile release]; self.aPlayer = newPlayer; [newPlayer release]; [aPlayer setDelegate:self]; [aPlayer prepareToPlay]; [aPlayer play]; } } - (void)audioRecorderDidFinishRecording:(AVAudioRecorder *)sender successfully:(BOOL)flag { NSLog (@"audioRecorderDidFinishRecording:successfully:"); [recorder release]; recorder = nil; } Checking the debugger, it flags the error here @synthesize aPlayer, recorder; This is the part I don't understand. I thought it may have something to do with releasing memory but I've been careful. Have I missed something?

    Read the article

  • Why is UIControlTouchUpInside UNDEFINED?

    - by munchine
    I've got a simple question but it has got me confounded. The code below gets an UNDEFINED error for UIControlTouchUpInside. What do I need to include or import? If I comment out the line, it works. So that means forState:UIControlStateNormal is defined. I'm new so hope you can help. UIButton * button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button setTitle:@"Accept?" forState:UIControlStateNormal]; [button addTarget:self action:@selector(acceptTapped) forControlEvents:UIControlTouchUpInside];

    Read the article

  • Return a number between 0 and 4

    - by munchine
    How do I return a number between 0 and 4, depending the input number? For example if I pass it number 23 it will return 3. The number set should look like 0 5 10 15 20 .. 1 6 11 16 21 .. 2 7 12 17 22 .. 3 8 13 18 23 .. 4 9 14 19 24 What's the math for this?

    Read the article

  • Why is forControlEvents UNDEFINED?

    - by munchine
    Hi Guys, I've got a simple question but it has got me confounded. The code below gets a UNDEFINED error for UIControlTouchUpInside. What do I need to include or import? If I comment out the line, it works. So that means forState:UIControlStateNormal is defined. I'm new so hope you can help. UIButton * button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button setTitle:@"Accept?" forState:UIControlStateNormal]; [button addTarget:self action:@selector(acceptTapped) forControlEvents:UIControlTouchUpInside]; button.frame = CGRectMake(225.0, 145.0, 80.0, 30.0); [self.view addSubview:button];

    Read the article

1