This file contains 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 <XCTest/XCTest.h> | |
#import "PMODownloader.h" | |
#import "PMODownloadNotifications.h" | |
@interface PMODownloaderTests : XCTestCase | |
@property (strong, nonatomic) PMODownloader *downloader; | |
@end | |
@implementation PMODownloaderTests |
This file contains 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 <XCTest/XCTest.h> | |
#import "PMOPictureController.h" | |
#import "PMODownloadNotifications.h" | |
@interface PMOPictureControllerTests : XCTestCase | |
@property (strong, nonatomic) PMOPictureController *pictureController; | |
@end | |
@implementation PMOPictureControllerTests |
This file contains 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
NSArray *numbers = @[@6,@4,@7,@90]; | |
NSNumber *maxNumber = [numbers valueForKeyPath:@"@max.self"]; | |
NSNumber *minNumber = [numbers valueForKeyPath:@"@min.self"]; | |
NSNumber *sumOfNumbers = [numbers valueForKeyPath:@"@sum.self"]; | |
NSNumber *avgOfNumbers = [numbers valueForKeyPath:@"@avg.self"]; | |
NSLog(@"\nmin: %@\nmax: %@\nsum: %@\navg: %@", minNumber, maxNumber, sumOfNumbers, avgOfNumbers); | |
NSDate *today = [NSDate date]; | |
NSArray *dates = @[today, |
This file contains 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> | |
#import "PMOLottoNumbers.h" | |
@interface PMOTransaction : NSObject | |
@property NSString *name; | |
@property NSNumber *amount; | |
@property NSDate *transactionDate; | |
@end |
This file contains 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> | |
int main(int argc, const char * argv[]){ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
int n; | |
int k; | |
scanf("%i %i",&n,&k); | |
int a[n]; | |
for(int a_i = 0; a_i < n; a_i++){ |
This file contains 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> | |
#import "PMODownloaderFromURL.h" | |
/** | |
Forward declaration of the used and referenced protocol | |
*/ | |
@protocol PMODownloaderFromURL; | |
@protocol PMODataHolder <NSObject> |
This file contains 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> | |
#import "PMODataHolder.h" | |
/** | |
Forward declaration of the used and referenced protocol | |
*/ | |
@protocol PMODataHolder; | |
@protocol PMODownloaderFromURL <NSObject> |
This file contains 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> | |
#import <UIKit/UIKit.h> | |
//1 | |
#import "PMODataHolder.h" | |
//2 | |
@interface PMOPictureController : NSObject <PMODataHolder> | |
/** | |
The designated initializer, the picture's url is mandatory to pass. |
This file contains 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 "PMOPictureController.h" | |
#import "PMODownloader.h" | |
#import "PMOPictureWithURL.h" | |
#import "PMODownloadNotifications.h" | |
@interface PMOPictureController() | |
/** | |
Our private data class, storing and hiding the information. |
This file contains 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> | |
//1 | |
#import "PMODownloaderFromURL.h" | |
//2 | |
@interface PMODownloader : NSObject <PMODownloaderFromURL> | |
/** | |
Property to store the downloaded data in NSData format | |
*/ |