Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Build a Simple iPhone App (iOS7) audio and other problems

In the "Customizing a Button" video from the "Designing your app" Badge there is no audio.

Another problem I found is in the second stage of the Code Challenge in "Refactoring into a Model" Badge. Maybe I'm wrong but the text says "... implement a 'quotes' method which will allocate and initialize the '_quotes' instance variable only if it is NOT 'nil'." Shouldn't be "... only if it is 'nil'"?

Last thing is about setting the 'predictions' property to readonly. After setting it as in the video, Xcode is complaining even in the CrystalBall.m file. What should i do? Thank you :)

2 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Thanks for bringing this to our attention, we are looking into the audio issue.

As for the code challenge, you are right it should be 'only if it is nil'.

As for the read only issue. Can you paste the code for your 'CrystalBall.m'

The code is the following

#import "SGCrystalBall.h"

@implementation SGCrystalBall


- (NSArray*)predictions{
    if (_predictions == nil){
        _predictions = [[NSArray alloc]initWithObjects:@"It is certain",
                        @"It is decidedly so",
                        @"All signs say yes",
                        @"The stars are not aligned",
                        @"My reply is no",
                        @"You didn't focus enough", nil];

    }
    return _predictions;
}

- (NSString*)randomPrediction{
     int random = arc4random_uniform(self.predictions.count);
    return [self.predictions objectAtIndex:random];
}
@end

Thank you

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

After the @implementation add the following line:

@synthesize predictions = _predictions;

What's happening is that since the property is declared as readonly an instance variable is not being created for you. So we need to manually create one.

Sorry about this, I will add an addendum to the video to point that out.

Thanks it worked ;) Keep the videos coming. I feel like I'm learning a LOT. I love you guys

Hi Simone! So sorry about the audio issue. I have made the fix and hopefully it's up and running now! I did notice a few bugs with audio while using Safari today, so it's possible it could be a browser issue. It seems to be working fine in Google Chrome right now :)

Hi I'm using Chrome so i got no audio issue except for the video i mentioned above. Thank you for fixing this I LOVE your iOS projects

OK unfortunately i found other problems :( In the Using Auto Layout from 9:23 to 10:40 the video becomes black :/ Another bug i found is the code challenge for Retina display which gives error for the iPhone 4S screen resolution (640 x 960) even though i'm quite sure is the right one ;) Finally in the Image based animation the download link is for the simple background used in previous videos, not for the 60 images zip needed for the animation.

Could you check this?