ios-4.2

Execute a “prepared” math operation in Objective-C

北慕城南 提交于 2019-12-06 16:00:20
问题 I want to to math operations with some kind of prepared formula that would look like tan(%f)*1000 or %f+%f where the %f has to be replaced by an argument. Is there a function in Objective-C that I can pass the format of my formula and the required numbers to execute this prepared operation? I hope the problem is described understandable, if not, leave a comment. Thanks in advance. Edit 1: Thanks for your answers so far, but I'm looking for something more dynamic. The block and inline function

Unable to display printer options with AirPrint

偶尔善良 提交于 2019-12-06 04:22:01
I want to add AirPrint functionality to my iPad application I have been trying to display printer ontions described in Apple's Drawing and Printing Guide I have toolbar and UIBarButtonItem *printButton . In controller I receive onPrintClick and try to display printer options by such code: UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController]; [controller setDelegate:self]; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { [controller presentFromBarButtonItem:self.printButton animated:YES completionHandler:completionHandler]; } else {

How to customize the UIToolbar with buttons that contains colored images?

我只是一个虾纸丫 提交于 2019-12-05 15:04:14
I have two questions about the UIToolbar: 1: I have read numerous Stackoverflow answers on how to use buttons with custom images (colored) in a UIToolbar. I have tried to put a view (hack) on top of the UIToolbar and put the buttons with the images in it, but failed. Right now I am stuck. How can you accomplish this? 2: Is there a way to have many buttons in "pressed" state simultaneously? The function I want to accomplish is different buttons with different kind kinds of sorting. Christofffer Ok the answer solved itself... here it is: Can I have a UIBarButtonItem with a colored image? -(void

how to set uitoolbar's background similar to my navigation bar

耗尽温柔 提交于 2019-12-05 06:49:39
Hello everyone: I have set a custom background for my navigation bar, it's a tint color i think that i chose from IB. Now i want to change the my uitoolbar's (added programmatically) background similar to my navigation bar, programmatically. Obliged for any help in this regard. Sorry guys my bad it's actually navigation controller's toolbar. so this worked for me: self.navigationController.toolbar.tintColor=self.navigationController.navigationBar.tintColor; Thanks all of u guys for quick response especially @phooze which set me in the right direction :) UIToolbar also has a tintColor property,

Execute a “prepared” math operation in Objective-C

一世执手 提交于 2019-12-04 19:40:58
I want to to math operations with some kind of prepared formula that would look like tan(%f)*1000 or %f+%f where the %f has to be replaced by an argument. Is there a function in Objective-C that I can pass the format of my formula and the required numbers to execute this prepared operation? I hope the problem is described understandable, if not, leave a comment. Thanks in advance. Edit 1: Thanks for your answers so far, but I'm looking for something more dynamic. The block and inline function is great, but to static. I also understand that this may be something hard to achieve out of the box.

Compiling libpq with iOS SDK 4.2

梦想与她 提交于 2019-12-04 11:19:20
I'm trying to compile again the libpq for arm and i386 with the iOS SDK 4.2. I did last year for SDK3.x without any problems. Now, when I want to create the fat binary file with two files, I'm getting this error: specifed architecture type (arm) for file (/Users/montx/mylibs_sdk42/libpq.arm) does not match its cputype (7) and cpusubtype (3) (should be cputype (12) and cpusubtype (0)) I'm compiling again because my compiled files doesn't work with the latest iOS4.2 Detected an attempt to call a symbol in system libraries that is not present on the iPhone: fcntl$UNIX2003 called from function pg

Programmatically adding a shadow to a UIButton label

随声附和 提交于 2019-12-03 08:42:59
问题 I'm trying to add a 1px black drop shadow to a button label with no luck. I've tried this: self.setTitleShadowOffset = CGSizeMake(0, -1); but I get: Request for member 'setTitleShadowOffset' in something not a structure or union Any suggestions would be fantastic thanks! 回答1: The other answers do not properly set the shadow color (I suspect they didn't notice because they were trying to set the shadow color to what it is by default, black.) This code worked for me to add a white shadow to the

configure: error: C compiler cannot create executables in mac os terminal

て烟熏妆下的殇ゞ 提交于 2019-12-02 10:23:50
问题 i'm trying to Building libCURL in iOS 4.2, i do some steps in the terminal. The steps are : cd curl-7.21.2 export CC=/Developer\ 4.2/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.0.1 export CFLAGS="-isysroot /Developer\ 4.2/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk" export LDFLAGS="-isysroot /Developer\ 4.2/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -Wl,-syslibroot /Developer\ 4.2/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2

How can i fix my scrollView dynamically when i have more than one textViews in it?

馋奶兔 提交于 2019-12-02 08:55:25
I have a scrollView which consists of 3 textViews, buttons and labels in a detailView. i am using 3 text view because i need different fonts for my view title, date and description. problem is sometimes description is long and sometimes its small and same thing with headings. then view doesn't loog good at all because of alot of empty spaces between title and description. Is it possible to set the size of textView and scroll view dynamically or is there any better approach to solve this problem. thanx in advance Bogatyr You need to adjust the frames of the text views to match their respective

How do i replace spaces with +'s in Xcode

余生长醉 提交于 2019-12-02 07:07:49
问题 I am building an app with a lot of urls being called from a MySQL server. What I need to do for my app is take the textfield text and send it (which i already know how to do) BUT i need to replace the spaces with + (pluses) 回答1: Try with the string method - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement; str=[str stringByReplacingOccurrencesOfString:@" " withString:@"+"]; 来源: https://stackoverflow.com/questions/7284380/how-do-i-replace