This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.quoteText.text = arrayWithSelectedQuotes[randomIndex][selectedCatergory]; | |
// But when you assing to the UI element the object Validates what you set, and if this is -->nil<-- it just puts empty string | |
if(self.quoteText.text == nil) { // false | |
NSLog(@"it's nil"); | |
} | |
if([self.quoteText.text isEqual: @""]) { // true | |
NSLog(@"It is empty string"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "QuoteQuiz.h" | |
@implementation QuoteQuiz | |
- (id)initWithQuiz:(NSString *)plistName { | |
if((self = [super init])) { | |
NSString *resourcePath = [[NSBundle mainBundle] pathForResource:plistName ofType:@"plist"]; | |
self.movieArray = [NSMutableArray arrayWithContentsOfFile:resourcePath]; | |
} | |
return self; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (id)initWithQuiz:(NSString*)plistName | |
{ | |
self = [super init]; | |
if (self) | |
{ | |
NSString *plistCatPath = [[NSBundle mainBundle] pathForResource:plistName ofType:@"plist"]; | |
self.movieArray = [NSMutableArray arrayWithContentsOfFile:plistCatPath]; | |
} | |
return self; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "MyQuiz.h" | |
#import "QuoteQuizViewController.h" | |
@interface QuoteQuizViewController () | |
@end | |
@implementation QuoteQuizViewController |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface MyQuiz : NSObject | |
@property (nonatomic, strong) NSMutableArray *quoteArray; | |
-(id) initWithTheQuiz : (NSString *) plistName; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict/> <!-- Why is that ? --> | |
</plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)nextQuizItem | |
{ | |
if (self.quizIndex == 999) { | |
self.quizIndex = 0; | |
self.statusLabel.text = @""; | |
} else if ((self.quiz.quizCount-1) > self.quizIndex) { | |
self.quizIndex++; | |
} else { | |
self.quizIndex = 0; | |
self.statusLabel.text = @""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<array> | |
<string>UIInterfaceOrientationPortrait</string> | |
<string>UIInterfaceOrientationLandscapeLeft</string> | |
<string>UIInterfaceOrientationLandscapeRight</string> | |
</array> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="ljd-vW-cIl"> | |
<rect key="frame" x="20" y="274" width="280" height="44"/> | |
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/> | |
<state key="normal" title="Button"> | |
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/> | |
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> | |
</state> | |
<state key="highlighted"> | |
<color key="titleCol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="ljd-vW-cIl"> | |
<rect key="frame" x="20" y="274" width="280" height="44"/> | |
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/> | |
<state key="normal" title="Button"> | |
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/> | |
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> | |
</state> | |
<state key="highlighted"> | |
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> |