Without using Interface builder or xib files, what is the correct way to instantiate two classes which inherit from UIView such that they can switch between themselves using UIButtons located on the views themselves?
I think this involves setting up a UIViewController from the app delegate and adding two instances of my classes which im...
I have seen the code below written 3 different ways (with regards to IBOutlet) Does it matter, I would say adding IBOutlet to both the declaration and the @property was more concise.
JUST PROPERTY:
@class SwitchViewController;
@interface iPhone_switcherAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
SwitchVi...
After a click of a Button I want to change to the next TabView and trigger the outcome of another class instance?
Any Examples somebody could give me?
...
Given the property declaration below, does method (A) work in exactly the same way as method (B). I just want to check that self.yellowViewController = yellcon_New is going via my setter so that the old objects gets release and the new one retained?
// INTERFACE
@property(nonatomic, retain) YellowViewController *yellowViewController;
/...
I'm very new to Objective-C and I'm trying to develop an iPhone app. My problem is I get "message sent to deallocated instance 0x3d54830" error when I use an object inside an NSTimer. When I don't use an NSTimer, I can use the object just fine. For example:
//These can be any objects. Le't say I have a Song class and a SongReader clas...
Hello there,
I have some code which requires an iPhone to run. I do however want to test my app on the simulator. On the iPhone I use this to return a value:
return [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:-1], @"number"];
I'm looking for something like this I THINK:
- (NSDictionary *) data
{
#if TARGET...
Hi
I added a category to CLLocation in CoreLocation but kept getting a link error.
I search around and through process of TRY IT AND BE DAMNED I fixed the problem by adding
-framework CoreLocation to Other Linker Flags
But dont know why?
I'm guessing its something to do with CoreLocation being and external framework.
The Code:
CLLoca...
I have a puzzling problem -- it seems like it should be so easy to do but somehow it is not working. I have an object called Player. The Manager class has four instances of Player:
@interface Manager
{
Player *p1, *p2, *mCurrentPlayer, *mCurrentOpponent;
}
// @property...
The Manager object has initPlayers and swapPlayers meth...
Hi all!
I am using Apple's MyGizmoClass Singleton class for program-wide "session variables" and loving it! However, when I run "Build and Analyze" it gives weird results. Maybe my usage is wrong (it works, but it may be working due to a flakey side effect). Here is an example.
- (NSInteger)tableView:(UITableView *)tableView numberO...
Hi,
I have the following code:
- (void)drawRect:(NSRect)dirtyRect
{
[[NSBezierPath bezierPathWithOvalInRect:[self theRect]] stroke];
}
- (NSRect)theRect
{
return NSMakeRect(1, 1, 1, 1); // made up some values
}
When I compile it says "Incompatible type for argument 1 of 'bezierPathWithOvalInRect' error". When I do this, howev...
I have actually one app with a SQLite DB and i port this at the moment to the ipad.
My idea is a sync between iPad and iPhone for one table... But the Problem is "Person A" edit/change, create or delete a data record on iphone and "Person B" make the same or delete the edited record from Person A on the same time. Has anybody a idea for...
I have an iPhone app that displays a modal view controller. The modal view controller shows two instances of a custom subclass of UITextView called RoundedTextView, an MKMapView, and a UIToolbar. I construct the viewController only once, and reset its data and present it each time the user summons it.
When showing this view controller w...
Hi,
I currently have a color well which keeps track of a color that gets saved in the NSUserDefaults. It is bound to an NSUserDefaultsController. However, I also want to listen for changes to the color so I can update my views accordingly. Therefore, in addition to the binding, I added a target/action to the color well to my preferences...
Hi,
Is it possible to play youtube using the method described in this url
http://iphoneincubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application
but with a custom button? (i.e in the picture in the link, it's of a baseball game with the play button overlay on top, I want that to be a custom button that I create)
...
When running this code under debug in the iPhone simulator, it correctly exits with r==4 after 5 iterations of the loop:-
int r;
for (r = 0;;r++)
{
if (r == 4)
break;
}
Without the braces, it exits with r==1 after 1 iteration:-
int r;
for (r = 0;;r++)
if (r == 4)
break;
Without the braces, but with a test ex...
Are the names of some initializer methods like 'initWithRequest' reserved in the API?
I have the following classes
@interface MTURLRequest : NSObject {
...
}
...
@end
and
@class MTURLRequest;
@protocol MTURLRequestHandlerDelegate;
@interface MTURLRequestHandler : NSObject {
...
}
-(id)initWithRequest:(MTURLRequest*)request_ d...
Could I write c++ code that interacts with the iPhone Quartz 2D framework, or can I only using objective-c?
Thanks
...
I declared an enum in my implementation file as shown below, and declared a variable of that type in my interface as PlayerState thePlayerState; and used the variable in my methods. But I am getting errors stating that it is undeclared. How do I correctly declare and use a variable of type PlayerState in my methods?:
In the .m file
@im...
Made a new window application. Right-clicked Frameworks > Add Existing Frameworks. Selected Frameworks folder, then AudioToolbox.framework.
Build, and 11 crashes.
#elif defined __ppc__ || __ppc64__
#define _IntSaturate(x) ((int) (x))
#else
#error "Unknown architecture."
// To use unoptimized standard C code, remove above line.
#defi...
i'm attempting to add my own continuous pitch modulation (vibrato) to my OpenAL object by assigning the sound's pitch to the path of a sine wave. this is my callback method, which is repeating every 1/30 of a second, as well as the getter and setter for the pitch.
#define kMaximumAplitude 0.025
#define kVibratoDegreeIncrements is 45
#d...