I've got a simple example where i have a delegate that has a string, along with a property to expose it.
myAppDelegate.h
#import <UIKit/UIKit.h>
@interface myAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
UITabBarController *rootController;
NSString* myText;
}
@property (nonatomic, retain) IBOutlet UIWi...
i have a method in subclass of UIView like this
-(void) reDrawPreviewWith:(UIColor *)textColor withGlowColor:(UIColor *)glowColor withGlowIntensity:(float)glowIntensity
I am calling this method by
float glowIntensity = 30.0f;
[preview reDrawPreviewWith:[UIColor colorWithRed:red green:green blue:blue alpha:1.0]
...
What is the difference between (retain, nonatomic) and (nonatomic, retain) in code such as this:
@property (retain, nonatomic) YellowViewController *yellowViewController;
?
...
In a header file such as this, when would an instance variable be used and when would a property be used?
Do they have to have the same name?
#import <UIKit/UIKit.h>
@class BlueViewController;
@class YellowViewController;
@interface SwitchViewController : UIViewController {
YellowViewController *yellowViewController;
BlueView...
Hi there,
I'm just starting out on my first 'real' cocoa app. Note that this is Mac, not iPhone.
This function is called when my async download of onemanga finishes, and is intended to parse an NSArray list of manga from it. I get a NSArray from nodesForXPath, and retain it to make sure it's mine. (Also tried retaining it twice, heh). ...
i am trying to open a url
(http://c22.smaato.net/oapi/lp.jsp;jsessionid=E253E547A55290CA553F493659433DBF.c22)
on a button through the following code
NSString *strs=[[NSString alloc]initWithFormat:@"%@",[linkArry objectAtIndex:0]];
NSURL *urls = [NSURL URLWithString:strs];
[[UIApplication sharedApplication] openURL:urls];...
Hey
I want to read binary file on my iPhone.
I have .txt file which stores information about an array: int[6000][9]
How can I put this data into an array in my code?
I tried this:
int mapa1[6000][9];
NSFileHandle* file = [NSFileHandle fileHAndleForReadingAtPAth: @"level1.txt"];
[[file readDataOfLength:4] getBytes:mapa1];
mapa1 = NSSw...
Hello everyone
I'm new to Mac programming but generally liking it. I have the following problem:
I have two core data entities linked through a one-to-many with their respective arraycontrollers (Stock Controller and Price History Controller, where the latter controller is bound to the Stock Controller, with Controller Key = selection ...
I am a newbie in Objective-c and I would like to implement fluent interface pattern in my OC class. Here is my updated and simplified case from my project:
// .h file
@interface MyLogger : NSObject {
...
}
- (MyLogger*) indent:(BOOL)indent;
- (MyLogger*) debug:(NSString*)message, ...;
- (id) warning:(NSString*)message, ...;
....
@end...
Hi all!
I wonder, whether it is possible to add/append another item to an existing enum type (part of a framework)?
Something like this: We have the enum type
typedef enum {
UIModalTransitionStyleCoverVertical = 0,
UIModalTransitionStyleFlipHorizontal,
UIModalTransitionStyleCrossDissolve,
UIModalTransitionStylePa...
I'm working on a Core Data-based application that has a Mac application acting as a 'server' and an iPhone as a client. Everything is going swimmingly, except I'm running into performance issues.
When the user taps an object, the server must return some objects related to that object (nothing too heavy, usually 3-4 objects) and show a U...
I just downloaded the code from http://cocoadevblog.com/iphone-tutorial-creating-a-rss-feed-reader to see how to implement rss feeder And it shows a warning " class 'Parser' does not implement the 'NSXMLParserDelegate' protocol " at [rssParser setDelegate:self]; in parer.m. App loads in simulator but does not work. I checked in refernces...
I looked at Apple's UIModalTransitionStyle, but didn't see what I was looking for. I want to do the same thing that the Facebook iPhone App does; when you touch on a button on the Facebook's homescreen, the new UIView appears (and then disappears when you are done) from the middle of the screen. I would like to implement similar transi...
Hi
In Xcode, suppose that there is a framework named Foo. Inside the Foo.framework/Headers folder there are files File1.h and File2.h. The header file File1.h includes File2.h via the following directive:
#include <File2.h>
The Foo framework is a re-package of a C++ library not specifically targeted for the Mac.
Now suppose I have...
Ok, I'm very new to Obj-C and Cocoa, but I'm sure my bindings here are correct. I've been googling, searching stack overflow and have checked my values again and again.
So, here are my bindings:
They connect to this class:
@interface TMMaddMangaWindowDelegate : NSWindowController {
...
}
...
@property (copy) NSMutableArray* mangaLi...
Hello.
I'm developing an iPhone application and I getting that warning at method:
NSNumber *latitudeValue;
NSNumber *longitudeValue;
[self obtainLatitude:latitudeValue longitude:longitudeValue];
The method is declared as follows:
- (void) obtainLatitude:(NSNumber *)latitudeValue longitude:(NSNumber *)longitudeValue {
NSNumberF...
I am trying to programatically create an image from the current frame of a MPMoviePlayerController video. I am using renderInContext called upon the player's view.layer however the image that is created is all black with the video player controls, but I am expecting to see the current frame of the video
My code (http://pastie.org/10200...
I have this class:
Header:
@interface vcMain : NSWindowController {
IBOutlet NSView *scroll;
}
@property (retain) IBOutlet NSView *scroll;
-(IBAction)test:(id)sender;
@end
Source:
@implementation vcMain
@synthesize scroll;
-(IBAction)test:(id)sender {
vItem *item = [[vItem alloc] initWithNibName:@"vItem" bundle:nil];
...
I have 2 classes, Parent and Child, and Parent has a class method named func.
Now I want to get Class instance in func method to distinguish which class is caller.
@interface Parent : NSObject
+ (void)func;
@end
@implementation Parent
+ (void)func {
Class *class = howToGetClass();
NSLog(@"%@ call func", class);
}
@end
@inter...
All,
I've been a Java developer for 10 years...when it comes to managing numerical data, for the most part I've stuck with int and used double when I need some decimal precision. The reason is we pretty much have a large heap space to work with and exhausting it is pretty difficult for the most part...
I'm starting iPhone development ...