hey guys,
I have a large image, and then i'm extracting a portion of the image out via:
[mBaseImage lockFocus];
NSBitmapImageRep* bitmapImageRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: NSMakeRect(startX,startY,width,height)];
[mBaseImage unlockFocus];
followed by:
extractedImage = [[NSImage alloc] initWithSize:[bitmapIma...
My example date is 08.10.2010 (friday), so the startdate should be 04.10.2010 (monday).
NSDate *today = [[NSDate alloc] init];
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *weekdayComponents = [gregorian components:NSWeekdayCalendarUnit fromDate:today];
NSDateComponents ...
i am wondering how i do a % sign within a NSString, i have tried \% and \\%
...
can any one please explain me what does @class declaration do in objective & what are the cases in which we should use this declaration.
Thanks in advance
...
I am quite new to core data I have read a couple of articles on Apples dev site & now am somewhat confortable with using it with one entity.
Now I am working on an app that recommends recipes to users.
The datadesign is somewhat like this I have these entities
Item
,
Pantry
&
Recipe
.
Relations are as follows:
...
I have a piece of Objective-C code I've inherited and the leak tracking tool has identified a memory leak in the code. I am not entirely up on the memory tracking rules of Objective-C so I'm having a real problem with understanding why the memory is leaking. The code is as follows:
+ (NSString *) getRecordingsDirectory
{
NSArr...
NSString *dateString = @"20.10.2010";
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateFormat:@"dd.MM.yyyy"];
[dateFormatter setLocale:[NSLocale currentLocale]];
NSLog(@"%@", [dateFormatter dateFromString:dateString]);
My output is:
2010-10-19 22:00:00 GMT
Why is one day lost?
...
Hi,
I am getting a weird compilation error - I dont know if there is a "ghost in the machine" or what?
Below if the code snippet where I am getting this error
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell ...
Hi Guy's
I am having string at first the method calls with timestamp value nil and I am getting converted the string into url .next time when I click load more results button again the method calls with time stamp value assigned to it.but the url string is not converting into NSURL iam getting the null value into it.
-(NSMutableArray*)...
I have a navigation bar button that displays both image and text. This is the code:
UIImage *saveImage = [UIImage imageNamed:@"star.png"];
UIButton *saveButton = [UIButton buttonWithType:UIButtonTypeCustom];
[saveButton setBackgroundImage:saveImage forState:UIControlStateNormal];
[saveButton setTitle:@"Save" forState:UIControlStateNor...
Hi, i came across the following piece of code which loads everything from photo album but what should i do if i only wanted to load the video type in the photo album on a table?
thanks in advance.
void (^assetEnumerator)(struct ALAsset *,NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop){
if(result != nil){
...
In Interface Builder you can drag a UIButton to the centre of a Navigation Controller, between the rightButtonItem and leftButtonItem.
I would like to do this programmatically, as i am not loading a xib.
I tried:
[self.navigationItem addSubview:myButton] // no luck
[self.navigationController.navigationBar addSubview:myButton] //no luc...
-(void)touchesBegan :(NSSet *)touches withEvent:(UIEvent *)event
{
[textValue resignFirstResponder];
[super touchesBegan:touches withEvent:event];
}
can someone explain me the meaning of this method???
...
Is it possible to generate an embedded Unix timestamp via a preprocessor macro?
For instance: #define VERSION_EXPIRE __TIMESTAMP__
The reason for this is, that i have beta versions and i want to generate an expire timestamp on compile time (in a special Debug build configuration).
Regards,
Erik
...
I get the below error many times and this error makes it impossible to run my application unless i restart the whole MAC. This is not caused due to changes in code.
ERROR :
"Couldn't register com.yourcompany. with the bootstrap server.Error: unknown error code.This generally means that another instance of this process was already runn...
i want to implement auto lock for a specific idle time interval.
How can i increase iphone autolock idle time feature programmatically ?
Thanks
...
Can anybody give an idea or sample code to display "drop-down / combo / listbox" in iphone using objective-c ?! Please please help me out.
...
Hi,
I am trying to make a map where I can look up locations, and put multiple pins on the map.
and when I want to look up other locations I want to remove all the old pins.
this is my code:
-(void)addPins:(GeocodeLocation*) location
{
CLLocationCoordinate2D locatie;
locatie.latitude = location.lat;
locatie.longitude = location.lon;...
I've come across some code that surrounds the return value from a method/function in parentheses.
What does that do?
The code I saw took an image, resized it and then returned it.
- (UIImage *)resizeImage:(UIImage *)image
{
//
// some fascinating, but irrelevant, resizing code here
//
return (image);
}
...
What is the best using of [super ... any method name]. Recently I have found out that In dealloc the [super dealloc] must stand in the same end. Because any variable what didn't use before can be filled by garbage if we set it after [super dealloc] It's a rare thing, but it's possible. After this we will have crash in our app.
So what i...