Hi i am developing an app for my QA department. I need to programically get how many phone numbers are there in the entire address book. No user input. Just click a button and then get how many phonenumbers are there in the ENTIRE addressbook.
Please email me at [email protected]
I'd like to create a regular expression that will match and return based on the following criteria:
1) I have N search terms entered by a user
2) I have a body of text.
3) I want to return a list of all the occurrences of all the search terms entered by the user plus surrounding context. I think (\w+\W+){,4}(", ")(\W+\w+){,4} might work.
4) I don't know how to use RegexKitLite at all. Do I invoke a RegexKitLite class? or does it interface into NSString somehow?
Hello,
I've used a familiar code to convert image to Black & White which I've founded on several forums.
The code is:
CGColorSpaceRef colorSapce = CGColorSpaceCreateDeviceGray();
CGContextRef context = CGBitmapContextCreate(nil, originalImage.size.width, originalImage.size.height, 8, originalImage.size.width, colorSapce, kCGImageAlphaNone);
CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
CGContextSetShouldAntialias(context, NO);
CGContextDrawImage(context, CGRectMake(0, 0, originalImage.size.width, originalImage.size.height), [originalImage CGImage]);
CGImageRef bwImage = CGBitmapContextCreateImage(context);
CGContextRelease(context);
CGColorSpaceRelease(colorSapce);
UIImage *resultImage = [UIImage imageWithCGImage:bwImage]; // This is result B/W image.
CGImageRelease(bwImage);
return resultImage;
When I'm using this code with on Horizontal image it's work fine,
but when I'm trying a to use this code on Vertical image, the result is
disproportionate image and rotate 90 degree left.
Can anyone know what could be the problem?
Thanks,
Kfir.
My problem is twofold: 1) I'm trying to determine an eloquent way to allow the user to type into a UITextView and store the time each word was typed into an array. The time will be a float which starts at 0 when the user begins to type. 2) Conversely, I'd like the user to be able to tap on a word in the UITextView and display the time that word was typed (displaying in an NSLog() is fine). Considerations that may throw a wrench into a possible approach -- what if the user goes back to the top of the text and starts typing or to the middle of the text?
Even a suggested approach without code would be appreciated, because right now I'm drawing a blank.
I know that javascript, for example supports functions inside of functions, like so:
function doSomething(){
function doAnothingThing(){
//this function is redefined every time doSomething() is called and only exists inside doSomething()
}
//you can also stick it inside of conditions
if(yes){
function doSomethingElse(){
//this function only exists if yes is true
}
}
}
Does objective-c support this? Theoretical example:
-(void) doSomething:(id) sender{
-(void) respondToEvent: (id) sender{
//theoretically? ... please?
}
}
BONUS: What is the proper term for a "local" function?
Hi,
I am building an app that plays multiple video files, But I would like to know How do you download a video file (100mb - 300mb) from a server into the application's bundle so it can later be locally referred to in code? The reason I want this type of a set up in my app is that I don't want the app binary to be made unnecessarily large due to including videos some users may not want. Also does this violate any of apple's terms? Also would it be simple to implement a progress view with this kind of set up and if so how?
Any help is appreciated.
I'm trying to build an iPhone application that has two subviews in the main window. Each view has its own UIViewController subclass associated with it. Also, within each controller's implementation, I've added the following method:
-(BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
Thus, I would expect both of the views to respond to changes in orientation. However, this is not the case. Only the first view added to the app's main window responds to orientation. (If I swap the order the views are added, then only the other view responds. In other words, either will work--but only one at a time.)
Why is this? Is it not possible to handle the orientation changes of more than one view?
Thanks!
EDIT: Someone else had this question, so I'm copying my solution here:
I was able to address this issue by providing a root view and a root view controller with the method "shouldAutoRotate..." and adding my other views as subviews to the root view. The subviews inherit the auto-rotating behavior, and their associated view controllers shouldn't need to override "shouldAutoRotate..."
hi..
i am using UIviewcontroller subclasses. In my main view i have 3 buttons, each button will load a different nib. and each new nib is having one back button to come back to main view.
when i click one the back button of any view to move to the main view the dealloc of that view is not getting called? i didnt understood this.
can anyone explain when those views dealloc will be called?
hi,
I'm trying to check if a given URL is valid and i'm doing it like this:
- (BOOL)urlIsValid:(NSString *)address {
NSURL *testURL = [NSURL URLWithString:address];
if (testURL == nil) {
return NO;
}
else {
return YES;
}
}
Since "URLWithString" is supposed to return "nil" if the URL is malformed I thought this would work but it doesn't for some reason. Could someone please tell me why?
Thanks in advance!
I've seen several questions/answers related to entirely creating a button in code, but not one which would let me know how to change the button image in code, when I originally added the button to my NIB in Interface Builder. I know how to change the background in Interface Builder.. but I want to change it in code, so I can change it automagically. Any help really appreciated!
Perhaps the answer is so obvious nobody needs to ask.. if so please forgive the dweeb that I am and help! :-)
New to MapKit. Having problems centering map around a specified point. Here is the code. Not sure why this is not working. We are expecting to see a map centered around Cincinnati, OH. What we are seeing is the default google map of the world.
Any help appreciated.
/ Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
CLLocationCoordinate2D mapCoords[2];
mapCoords[0].latitude = 39.144057;
mapCoords[0].latitude = -84.505484;
mapCoords[1].latitude = 39.142984;
mapCoords[1].latitude = -84.502534;
MKCoordinateSpan span;
span.latitudeDelta = 0.2;
span.longitudeDelta = 0.2;
MKCoordinateRegion region;
region.center = mapCoords[0];
region.span = span;
[mapView setRegion:region animated:YES];
}
I'm using Xcode 2.5 on Mac 10.4.11 PPC. javac -version returns 1.5.x yet when I imported my source code and tried to build it in Xcode, I get errors all over because generics, annotations, and for-each loops are not supported in -source 1.3.
I thought I found the setting to change the source version in Xcode in the above but it doesn't work. Any ideas?
I am looking for some direction on how to render a barcode from a numeric string on an iPhone? The symbology is not really important right now just curious on the basics or third party support if necessary.
Thanks in advance.
Hi,
I am building an app that plays multiple video files, But I would like to know How do you download a video file (100mb - 300mb) from a server into the application's documents so it can later be locally referred to in code? The reason I want this type of a set up in my app is that I don't want the app binary to be made unnecessarily large due to including videos some users may not want. Also does this violate any of apple's terms? Also would it be simple to implement a progress view with this kind of set up and if so how?
Any help is appreciated.
TheAutoConfig URL says to run the script in the directory that contains your package's configure script,what that directory means?anybody has experienced this to execute the script?and also how can we extract tar file through that?
We can import class declaration with #import:
#import "SomeClass.h"
or declare with @class:
@class SomeClass;
What's the difference and when we should use each of them?
I have a root view controller with no nib file,
I tried adding this at cellForRowAtIndexPath as that passes in a UITableView as tableView.
So I put :
tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStyleGrouped];
It ran with no error but it didnt seem to change anything.
When I run my app, for some reason the view is pushed up too far. The space it is pushed up too far appears to be the height of the status bar. (
I am using a NIB. I have verified that both MainWindow and this view has the simulated status bar checked.
I'm not sure what could be wrong?
Any help appreciated.
I know that it can be installed on Core 2 Duo & Dual core processors.
I am using it right now.But,I am planning to buy new machine & wanna make sure that if I buy i3/i5,should be able to install Mac OS X & able to do iPhone development.
Thanks.
I know that it can be installed on Core 2 Duo & Dual core processors.
I am using it right now.But,I am planning to buy new machine & wanna make sure that if I buy i3/i5,should be able to install Mac OS X & able to do iPhone development.
Thanks.