I want to implement a movable UIView class (view moves when you touch on it and move your finger), e.g.:
@interface MovableView : UIView {
some members;
}
-touchesBegan;
-touchesMoved;
@end
How can I apply this code to UILabel, UIButton etc without multiple inheritance? In C++, I'd do it like this (with UIView as a virtual base to ...
My question is, what directory does the NSFileManager start out in, I am really confused because when I run code to tell me what directory I'm in, it just outputs /. Also I can change directory to /private/var but not into /mobile and /mobile/applications which is where the application is. Bellow is my code.
NSString *currentpath;
fil...
I am trying to support multiple orientations within an iPad application, and the views that the designer came up with aren't able to be setup with purely the springs/struts model. I have laid out the views in two seperate nib files and currently use the follow...
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)...
I'm using xcodebuild to compile my project. I use this on the command line:
xcodebuild -sdk iphoneos4.0 -configuration Distribution
It returns with the regular build information scrolling by, then shows this:
** BUILD SUCCEEDED **
Bus error
The package is built fine, so I'm not sure what is causing the Bus error after a su...
I would like to conditionally enable the objc_exception_throw global breakpoint for my app, only when I am doing a Debug build (not when doing a Release or Distribution build).
Is there a way to specify this build condition in Xcode's Breakpoints window?
...
I was thinking of making a dictionary app for my Objectiv C classes that I use, sort of a cheat sheet.
I want to be something like this;
Class --> Code Sample
Basically, a scroll view of the classes, then I can choose one that I want to know how to implement and then I get a complete code sample.
Anyone?
David.
...
i have been told to
Implement Delegate Callbacks.
In your header file, implement the callbacks, MFMessageComposeViewControllerDelegate and UINavigationControllerDelegate.
how would i do this ?
Thanks
Mason
...
I have a need to enumerate the applications that have "windows", "icons", whether if they are minimized to the dock or not. I need basically the list of applications that Command-TAB brings you. How do you do this programmatically?
Everything I tried gave me everything, or just the applications that are NOT minimized. Drives me nuts. T...
I would like to hide and show a number of buttons at random which should run in a 30 sec timer.
How is a timer created in objective C?
Thanks
...
I tried to display imagecells in tableview, but the program crashes..
here's my imageCell class:
@interface ImageCell : NSTextFieldCell {
NSImage *imageIcon;
NSString *labelStr;
}
@property (retain) NSImage *imageIcon;
@property (retain) NSString *labelStr;
- (id) initWithLabel:(NSString *) labelString imageName:(NSString *) i...
I've run into an while trying to launch an NSTask from inside an NSOperation.
Here's a very simple app I've put together to showcase the problem. When you click the button, an NSOperation is queued. It sets up an NSRunLoop, and calls a method which invokes an NSTask. The task is really simple- it just launches /bin/sleep for two seconds...
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
gestureStartPoint = [touch locationInView:self.view];
NSLog(@"test x:%f",gestureStartPoint.x);
NSLog(@"test y:%f",gestureStartPoint.y);
etc..
Srangely, I'm not receiving any log statements if I click outside a 320x480 fra...
Whats wrong with my code.. I want it to read a text file like
Item1
Item2
Item3
Item4
Item5
and parse it into an array so each line is a separate object in thus array.
When you check the console it prints (null)
-(void)parseIntoArray{ //parse the files into seprate arrays.
allPools = [[NSMutableArray alloc] initWithContentsO...
I'm creating a custom progress bar and I've spliced it up into 1px images. If the progress bar were 100px wide then I would need 100 UIImageViews to fill the progress bar. The problem is this very quickly slows the iPhone down. How can I reuse an image view?
Anthony
...
I'm designing a Core Data app which needs to keep dated records.
Imagine a user works with the program for a while and some records are stored. The user then changes important attributes and relationships (which transcend individual records), and continues using the program with this new configuration. Imagine now that the user looks ba...
I've got a protocol:
@protocol Gadget <NSObject>
@property (readonly) UIView *view;
- (void) attachViewToParent:(UIView *)parentView;
@end
And an "abstract" base class, with an implementation (as a getter, not shown) of -(UIView *)view:
// Base functionality
@interface AbstractGadget : NSObject {
UIView *view;
}
@property (re...
If you are not developing for an Apple platform, are there reasons to choose Objective-C? I know of GNUstep (which I do not find visually pleasing), but what else is there?
If you want to develop for multiple platforms, including OS X or iOS but also Linux or Windows, when might Objective-C be a good choice?
...
Recently, an app was released on the AppStore that secretly allowed wifi-tethering from your iPhone. It quickly got pulled by Apple. Out of curiosity, are there any libraries for the iPhone SDK that helps developers write an application that does the same thing? I'm assuming you can deploy the app to your iPhone for testing purposes with...
Hi.
I'm using Objective-C language. But I don't know how to use c with Objective-C.
Ex) This is Function method.
- ( ?? ) function{
unsigned int first = ..
unsigned int second = ..
unsigned int third = ..
int infoData = {first,second,third};
return infoData;
}
How to fill in parenthesis.
I don't use NSArray.
Please help me.
...
Hi guys
I am developing an ipad app with openGL. In my app basically I am drawing a basic shape i.e 3d cube, which can rotate according to user's finger motion. Now I am stuck on coloring part of this cube. I want user to choose surfaces of his choice to color this shape.
So what I am trying to do is...I am changing the array for glCol...