UIDatePicker displays incorrect day in UIDatePickerDateAndTime mode for zones 12+ hours ahead of defaultZone
UIDatePicker (4.2.1) shows differing dates for the modes UIDatePickerDate (correct), and UIDatePickerDateAndTime (incorrect) when the timezone you assign to the UIDatePicker is - more than 12 hours ahead (east) of the systemTimeZone of the iPhone. For example, device system time zone = America/Los Angeles = GMT - 8 Honolulu date: Dec 7, 1941 7:48am Tokyo date: Dec 8, 1941 3:18am UIDatePicker will show the Tokyo date for mode UIDatePickerDate (correct): Dec 8, 1941 UIDatePickerDateAndTime: Dec 7, 1941 In fact, UIDatePicker will show incorrect dates in this case for any time zone east of GMT + 4 (always one day before correct day) A work-around in viewDidLoad is: self.datePicker.datePickerMode = UIDatePickerModeDateAndTime; self.datePicker.minuteInterval = 1; self.datePicker.timeZone = timeZone; [NSTimeZone setDefaultTimeZone:timeZone]; // *** add this line to force date picker to show correct date in all modes [self.datePicker setDate:tzDate animated:YES]; and in viewWillDisappear add: [NSTimeZone resetSystemTimeZone]; [NSTimeZone setDefaultTimeZone:[NSTimeZone systemTimeZone]]; Not super happy about the work-around, but it should be fairly robust even if this bug is fixed in future. If anyone can shed some light on this behavior, please advise. No amount of fooling around with calendars, locales, etc. fixed this until i reset the default zone. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Big Core Data, countForFetchRequest, and GCD
countForFetchRequest seems to bog down on really big collections of entities. For approx 170K entities it takes around 10 seconds on an iPhone 3GS to count them, which is a problem in a UITableView where you are trying to display a list of entities and associated counts. A GCD based solution, that queues up countForFetchRequest on a concurrent queue for each entity, and then updates the corresponding cell when finished, seems to work pretty well, although one or two big entity counts essentially bog down all the requests behind them. Counts are cached so that countForFetchRequest is only called once for any entity. Code below, can anyone suggest any further optimization or different approaches that might be more effective? (I'm aware of the danger of multi-threading core data - this particular managed object context never changes and nothing is happening to it on other threads when this read is going on) - (void) countEntitiesNamed:(NSString *)entityName inContext:(NSManagedObjectContext *)context forIndexPath:(NSIndexPath *)indexPath { NSNumber *rowCountObject = [self.rowCountMD valueForKey:entityName]; if (rowCountObject) return; // http://www.mikeash.com/pyblog/friday-qa-2009-08-28-intro-to-grand-central-dispatch-part-i-basics-and-dispatch-queues.html dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSEntityDescription *ed; NSFetchRequest *frq; frq = [[[NSFetchRequest alloc] init] autorelease]; ed = [NSEntityDescription entityForName:entityName inManagedObjectContext:context]; [frq setEntity:ed]; NSDate *startDate = [NSDate date]; NSUInteger rowCount = [context countForFetchRequest:frq error:nil]; NSTimeInterval timeInterval = -[startDate timeIntervalSinceNow]; DLog(@"%0.2lf seconds for %d %@ ",timeInterval,rowCount,entityName); dispatch_async(dispatch_get_main_queue(), ^{ [rowCountMD setValue:[NSNumber numberWithInteger:rowCount] forKey:entityName]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ objects", [NSNumberFormatter localizedStringFromNumber:[NSNumber numberWithInteger:rowCount] numberStyle:NSNumberFormatterDecimalStyle]]; }); }); } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: What is the point of a host-reachability test that doesn't test the reachability of the host?
Just to add another two cents on the unreliability of pings for determining reachability, if you are using the wi-fi service in certain airports, cafes, etc. some wi-fi providers will respond to a ping of anything, so it will appear you can reach any host, when in fact you can't reach anything except the providers home page until you authenticate. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Reusable Detail View Controller for UISplitViewController?
This seems too easy - seems to work great. Can anyone point out a defect with this approach? I want to reuse the same view controller instance as the detail view controller for a UISplitViewController - my experience is that constantly instantiating view controllers can be sluggish. Simply making the persistent view controller a child controller of the newly instantiated detail view controller seems to work just fine, as in // self.persistentDetailViewController is a view controller instantiated in viewDidLoad. - (void) addChildToDetailController { [self.detailViewController addChildViewController:self.persistentDetailViewController]; self.persistentDetailViewController.view.frame = self.detailViewController.view.frame; [self.detailViewController.view addSubview:self.persistentDetailViewController.view]; [self.persistentDetailViewController didMoveToParentViewController:self.detailViewController]; } #pragma mark - Segues - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"showDetail"]) { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; NSDate *object = self.objects[indexPath.row]; self.detailViewController = (DetailViewController *)[[segue destinationViewController] topViewController]; [self.detailViewController setDetailItem:object]; self.detailViewController.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem; self.detailViewController.navigationItem.leftItemsSupplementBackButton = YES; [self addChildToDetailController]; } } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Xcode warning from linking to a third-party framework in both app and in framework included in app?
I'm linking to the Parse.com frameworks in both my app and in a private framework of my own included in the app. This generates the linker warning below. Both the app and the included framework use objc[1735]: Class PFObject is implemented in both and . One of the two will be used. Which one is undefined. I guess I could simply make sure to only use Parse my private framework, but it seems like this should be fixable somehow... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Xcode warning from linking to a third-party framework in both app and in framework included in app?
Turns out the way to handle this seems to be: 1. Use an Other Linker Flag: "-weak_framework Parse" in the private framework target 2. Don't link to Parse in the Linker Build phase in the private framework target 3. Link as normal to Parse in the main app target. Clean the build folders all around, do the builds and the warnings are all gone. At least on Xcode 6.4... On Tue, Aug 18, 2015 at 10:23 AM, Jens Alfke wrote: > > On Aug 18, 2015, at 8:48 AM, Steve Mykytyn wrote: > > I'm linking to the Parse.com <http://parse.com/> frameworks in both my > app and in a private > framework of my own included in the app. This generates the linker warning > below. > > > If Parse provides their library in the form of a true (dynamic) framework, > you should use that and have both your app and your private framework link > against it. > > If they only provide a static framework/library, you can create a target > that builds that into a dynamic framework and exports the necessary > symbols, then do the above. > > —Jens > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
UIActivityItemSource and Facebook?
Working with the UIActivityItemSource, I'm finding that Facebook won't take anything except an image or URL - is there any way to supply it with text? My code works fine with Mail, Twitter, etc. The Facebook and Messenger apps will display a supplied image, will extract an image from a URL in preference to using the image, but don't take text. Is it me or them? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSBundleResourceRequest with Initial Install Tags not available immediately?
I've got an app, with a pre-built Core Data persistent store, that I'm trying to use with On-Demand resources, set up with Initial Install tags. Trying to use it on first run in the App Delegate, I'm finding that on a real device attached to Xcode, the resources are not immediately available on the device, but only after some delay. The persistent store is available eventually, but not having it immediately is leading me to all kinds of fragile attempts to keep the rest of the app from starting up too soon. The persistent store (gzipped) was previously just bundled with the app and worked fine that way. Can anyone shed any light on this? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
CloudKit queries for records with CKAssets - one or many?
I've got an app that displays 40-50 thumbnail images at a time via CloudKit. Right now it issues a CKQuery for each image when its corresponding UICollectionViewCell becomes visible. (Once I have them they are kept locally) I could launch 1 or 2 queries to retrieve the entire batch, which would of keep the queries per second down, but maybe be less responsive. Anyone have any experience with something similar? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
How to create a dial keypad with autolayout?
Having done this a number of times with springs and struts, I thought a telephone dial keypad would be a good way to learn the ins and outs of auto layout - 5 rows of three buttons each - Each button has a label (2) and optional label below (abc) - The width of the buttons always the same. - The height of each button changes between 3.5 and 4 inch iPhones Seems like this should be a straightforward use of auto layout, but I can't seem to get to a solution that does not have a very large number of constraints, which are very finicky if you try to adjust them. It's also very difficult to start with a row of three buttons, say, get that right, then duplicate that row and add/fix up constraints? Suggestions please? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSDateFormatter timeStyle NSDateFormatterFullStyle for dates earlier than 1970?
NSDateFormatter (iOS) does not produce time zone names (or abbreviations) prior to January 1, 1970, instead shifting to the "GMT-08:00" style. Is this a bug or a feature? Judging from the tz database, it should be able to produce names prior to 1970 if I understand tz correctly. NSDateFormatter does correctly interpret the actual changes in time, so that you can see the constant daylight savings in the US during World War II, and the change from LMT (local mean time) to Standard Rail Time on November 18, 1883. There were certainly names for time zones, such as "Eastern War Time" during WW II, and the tz database does contain references to W, for example, as a letter for constructing time zone abbreviations. Running backwards, NSDateFormatter for "Americas/Los_Angeles" produces -- Tuesday, June 10, 2014 at 12:00:00 PM Pacific Daylight Time -- Saturday, March 8, 2014 at 11:00:00 AM Pacific Standard Time -- Saturday, November 2, 2013 at 12:00:00 PM Pacific Daylight Time -- Saturday, October 24, 1970 at 12:00:00 PM Pacific Daylight Time -- Saturday, April 25, 1970 at 11:00:00 AM Pacific Standard Time -- Wednesday, December 31, 1969 at 11:00:00 AM GMT-08:00 -- Saturday, October 25, 1969 at 12:00:00 PM GMT-07:00 -- Saturday, September 23, 1950 at 12:00:00 PM GMT-07:00 -- Saturday, April 29, 1950 at 11:00:00 AM GMT-08:00 -- Friday, December 31, 1948 at 12:00:00 PM GMT-07:00 -- Saturday, March 13, 1948 at 11:00:00 AM GMT-08:00 -- Saturday, September 29, 1945 at 12:00:00 PM GMT-07:00 -- Sunday, February 8, 1942 at 11:00:00 AM GMT-08:00 -- Saturday, October 25, 1919 at 12:00:00 PM GMT-07:00 -- Saturday, March 29, 1919 at 11:00:00 AM GMT-08:00 -- Saturday, October 26, 1918 at 12:00:00 PM GMT-07:00 -- Saturday, March 30, 1918 at 11:00:00 AM GMT-08:00 -- Sunday, November 18, 1883 at 11:07:02 AM GMT-07:52:58 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSCalendar and NSDates prior to October 15, 1582
The documentation for the Date and Time Programming Guide for iOS does not seem to be telling the truth, or perhaps I'm doing something wrong. From https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/DatesAndTimes/Articles/dtHist.html "The Julian to Gregorian Transition NSCalendar models the transition from the Julian to Gregorian calendar in October 1582. During this transition, 10 days were skipped. This means that October 15, 1582 follows October 4, 1582. All of the provided methods for calendrical calculations take this into account, but you may need to account for it when you are creating dates from components. Dates created in the gap are pushed forward by 10 days. For example October 8, 1582 is stored as October 18, 1582." This code: NSCalendar *calendar = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]; DDLog(@"calendar = %@ ",calendar.calendarIdentifier); NSDateComponents *components = [[NSDateComponents alloc] init]; [components setYear:1582]; [components setMonth:10]; [components setDay:10]; NSDate *date = [calendar dateFromComponents:components]; DDLog(@"components2 = %@",components); DDLog(@"date = %@",date); yields this result: DateLimit: calendar = gregorian DateLimit: components2 = Calendar Year: 1582 Month: 10 Day: 10 DateLimit: date = 1582-10-10 07:52:58 + Every other calculation I've tried seems to indicate that NSCalendar provides a proleptic Gregorian calendar - i.e. it does not adjust for the October 15 following October 4 transition. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSCalendar and NSDates prior to October 15, 1582
Bug report submitted. It also turns out there are lots of interesting failures with NSDate, NSDateFormatter, NSCalendar, NSNumberFormatter, etc. if you go sufficiently far from the present -- 144,684 AD and 5,828,963 AD are the magic numbers in the positive direction. Blog post here: http://359north.com/blog/2015/02/08/the-limits-of-nsdate-and-friends/ iOS Project here: https://github.com/359north/nsdate-limits NSDate is precise to the second out to around 285,426,782 AD, but some of its compatriots let it down. On Thu, Feb 5, 2015 at 11:34 AM, Greg Parker wrote: > > > On 2015 Jan 30, at 12:32, Steve Mykytyn wrote: > > > > The documentation for the Date and Time Programming Guide for iOS does > not seem to be telling the truth, or perhaps I'm doing something wrong. > > Please file a bug report. > > > On Feb 5, 2015, at 6:56 AM, Jeffrey Oleander wrote: > > > > Some countries did not adopt the Gregorian adjustment until the 1750s, > and others much later than that (Russia partially converted in 1700 but not > completely until 1922, Turkey in 1926). Anyway, it's not something you can > do a neat mathematical conversion on and have it work "perfectly" > everywhere and for every date. What of those of us who have to deal with > dates going back to e.g. 1200BCE? > > The Date and Time Programming Guide mentions that issue too. > > "Some countries adopted the Gregorian calendar at various later times. > Nevertheless, for consistency the change is modeled at the same time > regardless of locale. If you need absolute historical accuracy for a > particular locale…" > > > -- > Greg Parker gpar...@apple.com Runtime Wrangler > > > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Core Data: following a relationship to set a transient attribute during awakeFromFetch
I am using transient attributes as a nice and efficient way to display formatted data (with line breaks) in an NSTableView, and am running into trouble in my awakeFromFetch: method for a subclass of NSManagedObject. This works fine in the awakeFromFetch: when building a transient attribute based on permanent attributes of the object in question, but I'm trying to follow relationships to retrieve attributes from several other NSManagedObjects. The relationship is to the correct NSManagedObject, which is a fault, as seen here: 12/14/08 5:50:43 PM myApp[14070] after we get it city = (entity: destination_city; id: 0x150d14e0 > ; data: ) Trying to access attributes of the relation just fails with a message like: 12/14/08 5:51:19 PM myApp[14070] *** NSRunLoop ignoring exception 'statement is still active' that raised during posting of delayed perform with target 0x14c90c80 and selector 'invokeWithTarget:' Sample code: awakeFromFetch: in my NSManagedObject subclass NSManagedObject *city = [self valueForKey:@"city"]; NSManagedObject *state = [self primitiveValueForKey:@"state"]; NSManagedObject *country = [self primitiveValueForKey:@"country"]; // * fails on the next statement - city is there, and marked as a default... NSString *cityName = [city valueForKey:@"city_name"]; NSString *stateName = [state valueForKey:@"state_name"]; NSString *countryName = [country valueForKey:@"countryName"]; NSString *transient_location = [NSString stringWithFormat:@"%@, %...@\n %@", cityName, stateName, countryName]; displayPatternValue is much slower than this approach and I don't want to denormalize my tables unless I have to do so. Suggestions? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
10.6 Base, 10.5 Target, runs fine on everything except Intel 10.5
Trying to build an app with base SDK 10.6, target OS 10.5. everything works fine on Intel 10.6, PPC 10.5, but I get a crash on PPC 10.5. Any suggestions? Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0002, 0x Crashed Thread: 0 Dyld Error Message: Symbol not found: _OBJC_CLASS_$_NSRunningApplication ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
10.6 Base, 10.5 Target, runs fine on everything except Intel 10.5 (repost)
(fumbled the previous post - sorry) Trying to build an app with base SDK 10.6, target OS 10.5. everything works fine on Intel 10.6, PPC 10.5, but I get a crash on INTEL 10.5. Any suggestions? Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0002, 0x Crashed Thread: 0 Dyld Error Message: Symbol not found: _OBJC_CLASS_$_NSRunningApplication___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: 10.6 Base, 10.5 Target, runs fine on everything except Intel 10.5
I know all about separating 10.6 from 10.5 stuff. The problem is: I've been testing on a 10.5 PPC machine, where everything works fine. On 10.5 Intel, it does not finish starting up, just crashes out. Never gets anywhere that I would use something 10.6 related. Trying to be as clear as possible: 10.6 Intel Snow Leopard - works fine 10.5 Intel Leopard - crashes complaining about NSRunningApplication 10.5 PPC Leopard - works fine Even if the startup sequence for an app was different between PPC and Intel, I'd expect to eventually crash out on both PPC and Intel if it was something I'm doing in the source code. This has got to be something with the way I have the project set up, which is about as vanilla as you can get... On Mar 9, 2010, at 2:45 PM, Steve Christensen wrote: > The class NSRunningApplication only exists on 10.6 and later. Are you doing a > runtime check before using it? > > Class nsRunningAppClass = NSClassFromString(@"NSRunningApplication"); > > if (nsRunningAppClass != NULL) > { > // 10.6 case... > NSRunningApplication* currentApplication = [nsRunningAppClass > currentApplication]; > ... > } > else > { > // 10.5 case... > } > > > > On Mar 9, 2010, at 2:30 PM, Steve Mykytyn wrote: > >> Trying to build an app with base SDK 10.6, target OS 10.5. >> >> everything works fine on Intel 10.6, PPC 10.5, but I get a crash on PPC >> 10.5. Any suggestions? >> >> Exception Type: EXC_BREAKPOINT (SIGTRAP) >> Exception Codes: 0x0002, 0x >> Crashed Thread: 0 >> >> Dyld Error Message: >> Symbol not found: _OBJC_CLASS_$_NSRunningApplication > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: 10.6 Base, 10.5 Target, runs fine on everything except Intel 10.5 [KIND OF SOLVED]
Thanks to everyone for their suggestions, particularly Greg Parker for the unambiguous clarification. While the safest approach is to use NSClassFromString to ensure that you can run in 64 bit on 10.5, I opted not to do that because it's not enough to actually get all 64-bit apps to work on 10.5, and it also has the downside of essentially requiring frequent testing on 10.5 Intel to make sure you didn't forget something - I'm not big on relying on humans to prevent errors, especially me. In my info,plist I force Leopard to run in 32 bit: LSMinimumSystemVersionByArchitecture x86_64 10.6.0 which results in everything running fine on all platforms, and solves an issue involving System Configuration as well: The issue involves the System Configuration and IOKit frameworks. If you use attempt to use certain functions from the System Configuration Framework in a x86_64 application on 10.5.8, you will get this crash report: - Date/Time: 2010-03-09 16:37:05.849 -0800 OS Version: Mac OS X 10.5.8 (9L31a) Report Version: 6 Anonymous UUID: 27FDECB3-E71F-4ED5-9E76-49DA5B513E3E Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0002, 0x Crashed Thread: 0 Dyld Error Message: Symbol not found: _SCDynamicStoreCreate Referenced from: /Users/smykytyn/Desktop/TEST.app/Contents/MacOS/TEST Expected in: /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit If you do an "nm" on the System Configuration and IOKit frameworks in the 10.5 and 10.6 SDKs, you will see that some SCF functions in the 10.6 SDK are shown in both frameworks, but not in 10.5 IOKit: Last login: Wed Mar 10 08:39:27 on console SM-MBP:~ smykytyn$ nm /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/IOKit.framework/IOKit | grep Dynamic SM-MBP:~ smykytyn$ nm /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/IOKit.framework/IOKit | grep Dynamic 0001f47f T _SCDynamicStoreCopyMultiple 0001f422 T _SCDynamicStoreCopyValue 0001f39d T _SCDynamicStoreCreate 0001f330 T _SCDynamicStoreCreateRunLoopSource 0001f582 T _SCDynamicStoreKeyCreate 0001f2c5 T _SCDynamicStoreKeyCreatePreferences 0001f1af T _SCDynamicStoreNotifyValue 0001f264 T _SCDynamicStoreSetNotificationKeys 0001f203 T _SCDynamicStoreSetValue The Growl people had an obscure reference to this about building for 64-bit using the 10.5 SDK as their workaround, although I can't find it right now. Perhaps there is some magic obvious solution to get all this to work correctly, but for now I'm restricting Leopard to 32-bit as I need to use these things. On Mar 9, 2010, at 3:25 PM, Greg Parker wrote: > On Mar 9, 2010, at 2:57 PM, Steve Mykytyn wrote: >> I know all about separating 10.6 from 10.5 stuff. The problem is: I've been >> testing on a 10.5 PPC machine, where everything works fine. On 10.5 Intel, >> it does not finish starting up, just crashes out. Never gets anywhere that >> I would use something 10.6 related. >> >> Trying to be as clear as possible: >> >> 10.6 Intel Snow Leopard - works fine >> 10.5 Intel Leopard - crashes complaining about NSRunningApplication >> 10.5 PPC Leopard - works fine >> >> Even if the startup sequence for an app was different between PPC and Intel, >> I'd expect to eventually crash out on both PPC and Intel if it was something >> I'm doing in the source code. > > I'm guessing that you crash on 10.5/Intel/Leopard/64-bit and do not crash on > 10.5/Intel/Leopard/32-bit. > > If you write anything like this and run on a system where the class is not > present, you will crash on 64-bit but may or may not crash on 32-bit: > > // BAD > [NSRunningApplication someMethod]; > > If NSRunningApplication may be absent at runtime, then you must not refer to > it directly, ever. You must use NSClassFromString() everywhere: > > // GOOD > Class nsRunningApplicationClass = > NSClassFromString(@"NSRunningApplication"); > [nsRunningApplicationClass someMethod]; > > > -- > Greg Parker gpar...@apple.com Runtime Wrangler > > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Xcode 3.23 broke my code signing
Project that built fine for weeks fails to pass validation, won't run when installed. Ran Xcode uninstall, reinstalled from scratch, same deal. Other than randomly trying stuff, does anyone have a known working procedure for fixing this??? Hard to think of a less productive way to waste time.___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Xcode 3.23 broke my code signing [FIXED]
For anyone else who runs into this: Reversion to 3.2.2 fixed the code signing issue. Black magic apparently. Nothing else worked. Apologies to anyone who thinks this should have been posted to a different list. On Apr 15, 2010, at 9:06 AM, Dave Reed wrote: > > On Apr 14, 2010, at 9:25 PM, Steve Mykytyn wrote: > >> Project that built fine for weeks fails to pass validation, won't run when >> installed. >> >> Ran Xcode uninstall, reinstalled from scratch, same deal. >> >> Other than randomly trying stuff, does anyone have a known working procedure >> for fixing this??? >> >> Hard to think of a less productive way to waste time. > > The Xcode-users list would be more appropriate but since your subject seems > to indicate version 3.2.3, you need to use the Apple Developer Forums > available at: > > http://developer.apple.com/iphone (link to them on the right after you log > in). > > Unrelated to the pre-release version, I did notice a temporary glitch a > couple days ago that seemed to be related to the itunesconnect site having > some temporary issues. A few hours later it was fine. > > Dave > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Core Data, Bindings, NSSearchField, and NSPopUpButton
I'm displaying a list of 100,000 or so global locations in an NSTableView, using an NSSearchField to help the user zero in on desired locations by street address, city, state, country, etc. It all works fine using Core Data plus bindings. And best of all no interface code... It would be handy to add an NSPopupButton with the list of countries to optionally restrict the search to a specific country while looking for a city name in the searchfield, say. Can't seem to find any relevant examples of this kind of thing with Core Data + Bindings, where two interface items are controlling the search. I prefer to keep the interface code to zero if possible. Suggestions on where to look or how to proceed? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
NSURLConnection willSendRequest: not behaving as expected on a 302 response - no further response after nil return
I'm using NSURLConnection to contact a URL that returns a 302 response along with some data, and then returns a 200 response with some different data. I want to stop it at the 302 response and get the data that comes along with the 302 response. To make this happen I understand the delegate method [NSURLConnection connection: willSendRequest: redirectResponse:] should return nil. To quote the documentation: "Alternatively, the delegate method can return nil to cancel the redirect, and the connection will continue to process. This has special relevance in the case where redirectResponse is not nil. In this case, any data that is loaded for the connection will be sent to the delegate, and the delegate will receive a connectionDidFinishLoading or connection:didFailLoadingWithError: message, as appropriate." Using tcpdump I can see the 302 response come back, along with the expected data, but I never receive anything from further from NSURLConnection after I return the nil above. No "didReceiveData:" or "connectionDidFinishLoading:" or "connection:didFailLoadingWithError:" - zip, zilch, nada. The code works fine for receiving 200 responses etc. Suggestions please? Slightly edited code below. #pragma mark NSURLConnection delegate methods - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse { return nil; // NEVER cache responses } - (void)connection:(NSURLConnection *)connection didReceiveData: (NSData *)data { @try { if ( connection && responseData ) [responseData appendData:data]; } @catch ( NSException *e ) { NSLog(@"exception during didReceiveData: %@", e); } } - (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse: (NSURLResponse *)redirectResponse { if(redirectResponse) { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) redirectResponse; statusCode = [httpResponse statusCode]; if (statusCode==302) newRequest = nil; // go for the first return only } return request; } - (void)connection:(NSURLConnection *)connection didReceiveResponse: (NSURLResponse *)response { @try { NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; statusCode = [httpResponse statusCode]; if (httpResponse) { // we know this is an NSHTTPURLResponse since we sent it to an http:// URL if (pageRequest==1) { // this is the first page request - which should just get the redirect info and go from there statusCode = [httpResponse statusCode]; if (statusCode==302) { if( connection && responseData ) [responseData setLength:0]; } } else if (pageRequest==2) { // this is the second page request statusCode = [httpResponse statusCode]; if (statusCode==200) { // success ... if( connection && responseData ) [responseData setLength:0]; } } } } @catch ( NSException *e ) { NSLog(@"exception during didReceiveResponse: %@", e); } } - (void)connectionDidFinishLoading:(NSURLConnection *)connection{ @try { NSString *tempString = [[NSString alloc] initWithData:responseData encoding:NSMacOSRomanStringEncoding]; [dict setValue:responseData forKey:@"body"]; [dict setValue:tempString forKey:@"bodyString"]; [tempString release]; // [connection release];connection=nil; [responseData release]; } @catch ( NSException *e ) { NSLog(@"exception during pageRequest %d connectionDidFinishLoading: %@",pageRequest, e); } } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your S
NSSearchField constants in search predicate binding?
I'd like to use constant values in certain NSSearchField search predicate bindings, but can't seem to get them to work. As in these two predicates ALL phoneNumber contains $value USA ONLY (phoneNumber contains $value) and (countryName contains 'United States') Is this possible, and what's the correct syntax if it is possible? I could not find anything obvious online, and thought the example above ought to work ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
alias link to libcrypto not working across different OS X versions
I have an app that needs to work across recent OS X versions. It links in the libcrypto.dylib, which is of course an alias. Path: /usr/lib/libcrypto.dylib Full Path: /usr/lib/libcrypto.0.9.x.dylib (anonymized to respect NDAs) App works fine on the dev machine with the newer OS X release, but when run on an older PowerPC machine with an older OS X, app crashes 1. because it can't find /usr/lib/libcrypto.0.9.x.dylib 2. if weak-linked, it simply does not load anything and then crashes. The older machine does not have /usr/lib/libcrypto.0.9.x.dylib, it has /usr/lib/libcrypto.0.9.y.dylib, which is where the alias resolves, but somehow the app does not get it right. I have everything set up correctly as far as SDK and dev target because I can detect a weak-linked Apple framework if it's there, it's just this bit with libcrypto that seems to be the issue. Suggestions? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Best Xcode machine mid-2019?
My main Xcode machine is a late 2013 27-inch iMac, 24GB RAM, 3.5 GHz Core i7 with 500GB SSD. It works fine, but I'm wondering if an iMac Pro or a top-of-the-line 2019 iMac would be a life-changing experience. Or just, "that's nice." The Geekbench numbers are somewhat informative, but hoping for commentary based on personal, direct experience. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Best Xcode machine mid-2019?
Thanks for all the advice. I set up the 4GB RAM disk, verified it was putting Derived Data there, and tested against a dynamic framework I build often. I even rebooted to have a clean starting point. The results were not great. The framework normally takes between 13 and 17 seconds to build, and the first try with the RAM disk took 19. After that it recorded some lower times, but essentially a minor improvement, if at all. A little surprising. Anyway, determined to stick with the 2013 machine for a while longer, it's still "good enough." On Fri, Jun 28, 2019 at 4:58 PM Jeff Szuhay wrote: > Compilation is largely an i/o-bound problem. Unless the projects you work > on are hideously > large and would benefit from parallel processing (splitting the i/o among > several processors), > your current machine is quite satisfactory. > > Try this: using your current system, create a 4GB disk partition in > memory. Then make that > partition the “Derived Data” location. > > You can see how here: [ > http://www.blinddogsoftware.com/goodies/#CacheInYourPocket] > > If you notice an improvement in stability and decreased build time, great. > If not, just keep > on building great apps. > > > On Jun 28, 2019, at 11:02 AM, Steve Mykytyn via Cocoa-dev < > cocoa-dev@lists.apple.com> wrote: > > My main Xcode machine is a late 2013 27-inch iMac, 24GB RAM, 3.5 GHz Core > i7 with 500GB SSD. > > It works fine, but I'm wondering if an iMac Pro or a top-of-the-line 2019 > iMac would be a life-changing experience. Or just, "that's nice." > > The Geekbench numbers are somewhat informative, but hoping for commentary > based on personal, direct experience. > > > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Best Xcode machine mid-2019?
The framework I'm building is written in Objective-C. I'm waiting for Swift to stabilize... Looking at Activity Monitor during the build, all four CPU cores are utilized symmetrically, the four hyper-threads somewhat less. The disk IO doesn't look like it's a bottleneck either. It does seem to run faster after a restart with no other apps running. I suppose this isn't a pure test of compilation - as it's a framework build, it's doing both x86 and arm builds, then lipo's them together, as well as doing a fair bit of copying due to large on-demand asset catalogs. It was worthwhile taking a look at the RAM disk, but I just didn't see enough benefit in my particular case. Whenever I go away from a pure vanilla setup, I usually regret it later. Thanks again for all the advice! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
On Demand Resource Trouble in Xcode 11 / iOS 13
I'm having a problem with ODR in Xcode 11. Worked fine in Xcode 10 / iOS 12, both device and simulator. 1. I have the asset catalog in the main bundle 2. I have the Build Setting set to YES for Embed Asset Packs in Product Bundle 3. I can see that the assets are correctly copied into the bundle. 4. The Appearances of each image is set to None 5. There are no spelling errors in the asset tags 6. Using the old build system 7. The production app on the App Store works fine on iOS 12, fails on iOS 13. I get varying results depending on the tag and the simulator / device. On a real iPhone 11 Pro, the method returns the tag not found error message: Error Domain=NSCocoaErrorDomain Code=4994 "The requested application data doesn’t exist." UserInfo={NSLocalizedFailureReason=InvalidTag} On an iPhone 11 Pro simulator, it finds the tagged resources, but trying to retrieve the images results in nil. Same failures on a simulated older device / OS (6s/11.0), which worked fine in the past. I've tried providing images for light, dark, etc. No luck. Any suggestions? At this point I'm getting ready to just avoid on demand resources entirely... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Code signing problem in one project...
I'm automatically managing code signing on all my Xcode projects. Just today, one started refusing to validate / distribute, claiming it was missing a private key. All the other projects continue to build just fine. Tried restarting Xcode, turned automatic signing on and off, deleted derived data, removed anything old in the keychain. No luck. Suggested next steps? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
UITableViewHeaderFooter frames?
I would like to get the frame of displayed UITableViewHeaderFooter views, but unfortunately [self.tableView.delegate tableView:self.tableView viewForHeaderInSection:i] returns the correct UITableViewHeaderFooter based on its textLabel, but the frame is all zeroes: Printing description of header: >; gestureRecognizers = ; layer = > I can get valid frames for UITableViewCells, but not the section headers. Any suggestions? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Tracking source of recommendation
Glad to see this list showing a little life, so I thought I would ask a question. I know how to make a link that app users can send to their friends as email/message/post to take them to the app on the App Store. What I would like to do is associate the new app user upon first launch with the user who recommended the app. I could provide a second link in the original email post with a scheme that would open in the app and correctly identify the recommending user, but that seems a little clunky. Is there a better way? On Thu, Apr 22, 2021 at 12:00 PM wrote: > Send Cocoa-dev mailing list submissions to > cocoa-dev@lists.apple.com > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.apple.com/mailman/listinfo/cocoa-dev > or, via email, send a message with subject or body 'help' to > cocoa-dev-requ...@lists.apple.com > > You can reach the person managing the list at > cocoa-dev-ow...@lists.apple.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Cocoa-dev digest..." > > > Today's Topics: > >1. Re: /Library/Application Support off limits? (Davidap) > (Jonathan Prescott) > > > -- > > Message: 1 > Date: Wed, 21 Apr 2021 16:46:51 -0400 > From: Jonathan Prescott > To: i...@nacsport.com > Cc: cocoa-dev@lists.apple.com > Subject: Re: /Library/Application Support off limits? (Davidap) > Message-ID: > Content-Type: text/plain; charset=us-ascii > > Adobe, Google, etc., use the Apple security frame works and interfaces to > temporarily elevate privileges to write their respective data to > /Library/Application Support, which is actually where this data should go, > based on Apple guidance. There is extensive documentation on this whole > issue in the Apple documentation. > > Jonathan > > -- > > Subject: Digest Footer > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins (at) lists.apple.com > > https://lists.apple.com/mailman/listinfo/cocoa-dev > > > -- > > End of Cocoa-dev Digest, Vol 18, Issue 28 > * > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How do you handle reading a plist if it may be an array or a dictionary?
You're creating your own problem here. If you are controlling what the configuration plist is, make it a dictionary at the top level with three keys and entries: idString - something that confirms to you that this is one of yours array - the array you want in some cases dictionary - the dictionary you want in some cases. Then you deserialize it, confirm it's one of yours, and branch on which of the latter two keys is not null. This kind of situation can arise if you are configuring multiple apps out of the same code base. If you're not controlling the configuration plist, just use NSPropertyListSerialization as noted previously and branch on what you get. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com