Hello, I am trying to superimpose two pdf pages; one on top of the other. I am using Cocoa and the PDFKit framework. When I superimpose the second page onto the first, the second page covers the content of the first page entirely (so the first page is no longer visible). Is there a way to change the transparency of the second page so tha...
Hello everyone,
I have a UIWebView that loads local HTML files. In one of those files/pages I have a video file embedded (with <video> tag) that plays correctly in both simulator and iPad, but in iPad I get this annoying warning message:
warning: Unable to read symbols for
"/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2...
Is there a way to convert an integer into a network short integer on the iphone? Also, how do I convert a network short to a host short. In c, it's htons and ntohs
Thanks
...
Here is what I am trying to do:
id<MyDelegate> _delegate;
....
[_delegate performSelectorOnMainThread...]
@protocol MyDelegate <NSObject>
....
My problem is that performSelectorOnMainThread is defined in a category of NSObject so the compiler doesn't recognize it. I get:
"warning: '-performSelectorOnMainThread:withObject:waitUntilDon...
I need to create a class that gets a delegate does some calculation and then calls the delegate.
Where am i suppose to release the object I allocated?
Is it possible to init the MyClass
object without allocating it, so
that way I don't have to release it.
What is the best practice to do such
a thing? (I am trying to create a
web servic...
In the following function which one is the best practice?
To send an autoreleased object, and make the caller retain it?
or send an allocated object, and make the caller release it?
- (NSString*) convertDataToString :(NSData*)myData
{
//just an example, method might not exist
NSString *str = [[NSString alloc] initWithDat...
I am getting the following build warning:
ld: warning: in /Users/syalam/Documents/git/stocktwits-iphone/AudioToolbox.framework/AudioToolbox, missing required architecture i386 in file
How can I resolve?
...
I have created a class as follows
@interface sampleClass: UIViewController
{
NSString *currentLocation;
}
@property (nonatomic, copy) NSString *currentLocation;
So, whenever the current GPS changes, a function will be called as follows:
-(void)newLocationUpdate:(NSString *)text {
NSString *temp = [[NSString alloc] initWithStrin...
Hello-
I am writing an iPhone app that needs to calculate the square root of a number about 2000 times every 1/30th of a second. sqrt() works fine on a computer, but the frame rate drops to around 10 FPS on an iPhone or iPad, and I have already optimized the rest of the code. I have heard that this can be sped up dramatically by estimati...
[self.tableView setContentOffset:CGPointMake(0,48) animated:NO];
I have a UITableView that has a a UIView in the header. My UITableView won't scroll to (0,48) unless animated: YES. I don't want it to animate.
Anyone know whats up?
...
I know that when i have a property for an object which is set to retain or copy i must do the following.
Object *o = [[Object alloc] init];
self.myObject = o;
[o release];
but what if i don't define a property for myObject?
Can i do the following without having a leak?
Is it better to define a property for every variable I have in e...
Possible Duplicate:
Can an objective C method signature specify an enum type?
"VoiceName" is an enum, declared like this:
enum VoiceName {
PAD_RHYTHM,
PAD_RHYTHM2,
PAD_RHYTHM3,
PEEPERS,
ATMOSPHERE,
IMPULSE,
FAST_PULSE,
HAIRYBALLS_PADS,
KICK
};
The compiler doesn't seem to like me using it...
"VoiceName" is an enum, declared like this:
enum VoiceName {
PAD_RHYTHM,
PAD_RHYTHM2,
PAD_RHYTHM3,
PEEPERS,
ATMOSPHERE,
IMPULSE,
FAST_PULSE,
HAIRYBALLS_PADS,
KICK
};
The compiler doesn't seem to like me using it in a method signature like this:
-(void)pulseFiredWithSamplePosition:(float)position from: (VoiceName) voiceName;
...
Hello,
I'm trying to use "insertNewObjectForEntityForName", but I've got a problem with my declaration, I wondered if someone had an opinion on this .
This is my implementation :
NSManagedObjectContext *context = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
// Create Object
Shots *newShot = (Sho...
I have a horizontal UIScrollView. It have 3 pages. It I have 3 UIButtons on each page of the scrollview. Total of 9 UIButtons. I need to set a different color when a button is touched, so that I can differentiate that touched button with the other buttons.
I tried setColor by checking BOOL values. It is working for single page.
When I ...
example: word with number in string
NSString *str = [NSString stringWithFormat:@"this is an 101 example1 string"]
Since example1 has a number in the end and i want to remove it. I can break it into an array and filter it out using predicate, but that seems slow to me since I need to do like a million of these.
What would be a more ...
I have a thread that modifies a passed pointer to an object (which is alloc'd and retained in the calling thread) in a loop. If I put the pointer in the autorelease pool, I sometimes get errors because the object is being released when it shouldn't. I took it out of the autorelease pool and this seems to work. However, I am worried about...
My app is a question/answer type forum for the iphone, where users view questions and answer. I'd like to implement a thumbs up system so users can give good answers the "thumbs" up. My backend is all php, so essentially when a user posts a question or answer, the data is passed via URL to my php script, which then inputs the data to my ...
I am trying to set the text of a UILabel to be equal to the name of the day of the week represented in an NSDateComponents. I am using the following code:
NSDateComponents *dateComponents = [[[NSDateComponents alloc] init] autorelease];
dateComponents.weekday = 1; //Sunday
NSString * const weekdayNames[8] = {@"Array starts at 1", @"Sun...
Case 1:
-(id)getAnObject{
Object *someObject = [[Object alloc] init];
//doing something
return someObject;
}
Case 2:
-(void)dealWithAnObject{
Object *someObject = [[Object alloc] init];
[assignTheObjectToOther someObject];
}
Both Case 1 and Case 2 have some warning in XCode, what s...