Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


ryantcb @ @ @


Last Active
Registered Users
  • Re: UITextView Scrolls to Middle When it First Appears

    [myTextView scrollRangeToVisible:NSMakeRange(0,0)]

    would also have worked. No idea why it offsets the text but it does. Still now you know the fix you'll never have the problem again :)

    oh and the most important part was the moving it to
    Post edited by ryantcb on
  • Re: xcode 6 beta 7 will not start

    When I install the beta it does take a good while for the application to launch. It bounces around on the dock and then stops. I would say it can take up to 5-8 minutes or more. My impatients means I always force quit and try again. I doubt that has any helpful effect but makes me feel better. I guess its doing loads of behind the scene checks. But juts be patient.
  • Re: Build and submit app from another mac?

    Just open it up and Xcode will prompt if any deprecated code. Know though as soon as u open any xib / storyboard Xcode will update to ios 7 style and as UI elements are different in ios 7 u may have a headache getting it to look as you want. As for distributing to App Store it's just a matter of installing the certificates and provisioning profiles. You will also need the latest non beta builds of the SDK and Xcode 5
  • Re: email attachment to app

    in your app delegate
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
    NSURL *url = (NSURL *)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];
        if (url != nil && [url isFileURL]) {
            [self.viewController handleOpenURL:url];
            return YES;
    UIApplicationLaunchOptionsURLKey is a Const that checks to see if the App was launced in order to handle a file

    then inside your viewController .h declare the handleOpenURL: method and in the .m file check if the file extension is a audio file and move to the documents folder of your application
    -(void)handleOpenURL:(NSURL *)url{
        NSError *error;
    // do the if statement for each handles file extension
        if ([[url pathExtension]isEqualToString:@"m4a"]) {
           NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
            // get documents path
            NSString *documentsPath = [paths objectAtIndex:0];
            // create the path to your audio file
            NSString *openURLFilePath = [documentsPath stringByAppendingPathComponent:@"nameYourAudioFile.m4a"];
        //declare an NSURL in the .h file
       //we will call it  'aURL'
        self.aURL = [NSURL fileURLWithPath:openURLFilePath];
       //move file to your documents folder 
            [[NSFileManager defaultManager]moveItemAtURL:url toURL:self.aURL error:&error];
      //then remove it from the installed location else it will be in your bundle twice
            [[NSFileManager defaultManager]removeItemAtURL:url error:&error];
    Post edited by ryantcb on
  • can't delete characters once appending string.

    I am adding text into a UITextfield that will hold a time string when user enters the first 2 numbers I add the ':' character.
    if (text.length ==2) {
                    textField.text = [NSString stringWithFormat: @"%@:", text];}
    The problem is id the user tries to delete their entry it wont go passed the : as every time they press delete at sat 23: it removes the : then appends it back again instantly as the the text.length again ==2. How can I delete the contents of the string before the : character.
    Hope I have explained myself enough.
    Post edited by ryantcb on