Re: Jiggling Shadow Offset

2013-05-22 Thread Jean Suisse
On 22 mai 2013, at 01:52, Seth Willits sli...@araelium.com wrote:

 Changing the blur radius has no affect on the offset. It still behaves the 
 same way. I'm not sure why you think 0.5 would be any different.

I believed that using 0.5 would solve the issue… because I have been there 
before. I should have mentioned that first, sorry.
IMHO, what you are observing is a plain bug because there is no way using a 
blur radius of 0.5 can yield an always visible shadow when using a bigger 1.0 
fails to do so.
Yet, as you can see in the video I sent you, it works perfectly.

Jean
Tests have been performed on a regular up-to-date 10.8.3 MBP equipped with a 
13 display.

 
 On May 21, 2013, at 3:44 PM, Jean Suisse wrote:
 
 Have you tried replacing 
 
 shadow.shadowBlurRadius = 1.0;
 
 With:
 
 shadow.shadowBlurRadius = 0.5;
 
 It should work as expected.
 
 Jean
 
 On 22 mai 2013, at 00:11, Seth Willits sli...@araelium.com wrote:
 
 What bit of obviousness am I missing here?
 http://www.sethwillits.com/temp/ShadowOffset.mov
 


---
Jean Suisse
Institut de Chimie Moléculaire de l’Université de Bourgogne
(ICMUB) — UMR 6302


___

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

scroll UITableView

2013-05-22 Thread Gerriet M. Denkmann
I have an UITableView with several searchOptions (like: Starts with, Ends 
with, etc.).

When the user changes the search option, the UISearchDisplayDelegate implements:

- (BOOL)searchDisplayController:(UISearchDisplayController *)controller 
shouldReloadTableForSearchScope:(NSInteger)searchOption
{
// create some data array with stuff, depending on searchOption
return YES;
}

Works fine.
But: when one scrolls in the table and then switches the searchOption the table 
shows the correct items, but at some arbitrary scroll position.

So I added this line in the above method:
[ self performSelector: @selector(scrollToTop:) withObject: 
controller.searchResultsTableView  afterDelay: 0 ];


- (void)scrollToTop: (UITableView *)tableView
{
NSIndexPath *indexPath = [ NSIndexPath indexPathForRow: 0 inSection: 0 
];
[ tableView scrollToRowAtIndexPath: indexPath  atScrollPosition: 
UITableViewScrollPositionTop  animated: NO ];
}

Seems to be working. 
But: is this the correct way?

One (minor) problem:
The UITableViewDataSource gets the message:  tableView:cellForRowAtIndexPath: 
first with some arbitrary rows, and then again with rows 7, 6, 5, ..., 0.
Some (small) waste of battery.

Gerriet.


P.S.
I changed searchDisplayController:shouldReloadTableForSearchScope: to return NO 
and added [tableView reloadData]; to my scrollToTop: method.
No more wasted row display.
But still I am not sure whether this is the right way.





___

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


CTLineGetTypographicBounds crash

2013-05-22 Thread Koen van der Drift
I'm looking to add some highlighting to my Core Text View, and implemented the 
following which comes straight from Apple's SimpleTextInput code example 
(https://developer.apple.com/library/iOs/#samplecode/SimpleTextInput/Introduction/Intro.html):

// Helper method for drawing the current selection range (as a simple filled 
rect)
- (void)drawRangeAsSelection:(NSRange)selectionRange
{
// If not in editing mode, we do not draw selection rects
if (!self.editing)
return;

// If selection range empty, do not draw
if (selectionRange.length == 0 || selectionRange.location == NSNotFound)
return;

// set the fill color to the selection color
[[SimpleCoreTextView selectionColor] setFill];

// Iterate over the lines in our CTFrame, looking for lines that 
intersect
// with the given selection range, and draw a selection rect for each 
intersection
NSArray *lines = (NSArray *) CTFrameGetLines(_frame);
for (int i = 0; i  [lines count]; i++) {
CTLineRef line = (CTLineRef) [lines objectAtIndex:i];
CFRange lineRange = CTLineGetStringRange(line);
NSRange range = NSMakeRange(lineRange.location, lineRange.length);
NSRange intersection = [self RangeIntersection:range 
withSecond:selectionRange];
if (intersection.location != NSNotFound  intersection.length  0) {
// The text range for this line intersects our 
selection range
CGFloat xStart = CTLineGetOffsetForStringIndex(line, 
intersection.location, NULL);
CGFloat xEnd = CTLineGetOffsetForStringIndex(line, 
intersection.location + intersection.length, NULL);
CGPoint origin;
// Get coordinate and bounds information for the 
intersection text range
CTFrameGetLineOrigins(_frame, CFRangeMake(i, 0), origin);
CGFloat ascent, descent;
CTLineGetTypographicBounds(line, ascent, descent, NULL);  
===  BOOM!
// Create a rect for the intersection and draw it with 
selection color
CGRect selectionRect = CGRectMake(xStart, origin.y - descent, xEnd 
- xStart, ascent + descent);
UIRectFill(selectionRect);
}
}
}



But every time, I get an EXC_BAD_ACCESS error for the 
CTLineGetTypographicBounds() call.  I triple checked that _frame and line are 
valid at this point, and the debugger output shows what it is supposed to be 
(correct string, attributes, etc).

Here's the output from bt:

(lldb) bt
* thread #1: tid = 0x1c03, 0x0027bbd0 CoreText`CTLineGetTypographicBounds + 29, 
stop reason = EXC_BAD_ACCESS (code=2, address=0x60)
frame #0: 0x0027bbd0 CoreText`CTLineGetTypographicBounds + 29
frame #1: 0x000469a4 MyApp`-[MyView drawRangeAsSelection:](self=0x4576f000, 
_cmd=0x, selectionRange=(null)) + 628 at MyView.m:461


Any suggestions why this could be happening?

Thanks,

- Koen.




___

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: CTLineGetTypographicBounds crash

2013-05-22 Thread Michael Babin
On May 22, 2013, at 8:05 AM, Koen van der Drift koenvanderdr...@gmail.com 
wrote:

 I'm looking to add some highlighting to my Core Text View, and implemented 
 the following which comes straight from Apple's SimpleTextInput code example 
 (https://developer.apple.com/library/iOs/#samplecode/SimpleTextInput/Introduction/Intro.html):
 
 // Helper method for drawing the current selection range (as a simple filled 
 rect)
 - (void)drawRangeAsSelection:(NSRange)selectionRange
 {
   // If not in editing mode, we do not draw selection rects
if (!self.editing)
return;
 
// If selection range empty, do not draw
if (selectionRange.length == 0 || selectionRange.location == NSNotFound)
return;
 
   // set the fill color to the selection color
[[SimpleCoreTextView selectionColor] setFill];
 
   // Iterate over the lines in our CTFrame, looking for lines that 
 intersect
   // with the given selection range, and draw a selection rect for each 
 intersection
NSArray *lines = (NSArray *) CTFrameGetLines(_frame);
for (int i = 0; i  [lines count]; i++) {
CTLineRef line = (CTLineRef) [lines objectAtIndex:i];
CFRange lineRange = CTLineGetStringRange(line);
NSRange range = NSMakeRange(lineRange.location, lineRange.length);
NSRange intersection = [self RangeIntersection:range 
 withSecond:selectionRange];
if (intersection.location != NSNotFound  intersection.length  0) {
   // The text range for this line intersects our 
 selection range
CGFloat xStart = CTLineGetOffsetForStringIndex(line, 
 intersection.location, NULL);
CGFloat xEnd = CTLineGetOffsetForStringIndex(line, 
 intersection.location + intersection.length, NULL);
CGPoint origin;
   // Get coordinate and bounds information for the 
 intersection text range
CTFrameGetLineOrigins(_frame, CFRangeMake(i, 0), origin);
CGFloat ascent, descent;
CTLineGetTypographicBounds(line, ascent, descent, NULL); 
 ===  BOOM!
   // Create a rect for the intersection and draw it with 
 selection color
CGRect selectionRect = CGRectMake(xStart, origin.y - descent, xEnd 
 - xStart, ascent + descent);
UIRectFill(selectionRect);
}
}
 }
 
 
 
 But every time, I get an EXC_BAD_ACCESS error for the 
 CTLineGetTypographicBounds() call.  I triple checked that _frame and line are 
 valid at this point, and the debugger output shows what it is supposed to be 
 (correct string, attributes, etc).
 
 Here's the output from bt:
 
 (lldb) bt
 * thread #1: tid = 0x1c03, 0x0027bbd0 CoreText`CTLineGetTypographicBounds + 
 29, stop reason = EXC_BAD_ACCESS (code=2, address=0x60)
frame #0: 0x0027bbd0 CoreText`CTLineGetTypographicBounds + 29
frame #1: 0x000469a4 MyApp`-[MyView 
 drawRangeAsSelection:](self=0x4576f000, _cmd=0x, 
 selectionRange=(null)) + 628 at MyView.m:461
 
 
 Any suggestions why this could be happening?


The preceding call looks like it could be problematic:

CTFrameGetLineOrigins(_frame, CFRangeMake(i, 0), origin);

If you want a single line origin (CGPoint), looks like the length of the range 
passed in should be 1, not 0.

From 
https://developer.apple.com/library/mac/#documentation/Carbon/reference/CTFrameRef/Reference/reference.html

 range
 The range of line origins you wish to copy. If the length of the range is 0, 
 then the copy operation continues from the start index of the range to the 
 last line origin.

___

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: CTLineGetTypographicBounds crash

2013-05-22 Thread Koen van der Drift

On May 22, 2013, at 10:05 AM, Michael Babin mba...@orderndev.com wrote:

 The preceding call looks like it could be problematic:
 
CTFrameGetLineOrigins(_frame, CFRangeMake(i, 0), origin);
 
 If you want a single line origin (CGPoint), looks like the length of the 
 range passed in should be 1, not 0.


Well spotted, that fixed it, thank you very much! 


I now get a bunch of Error: CGContextFillRects: invalid context 0x0 errors, 
which makes sense since this snippet does not have something like:

CGContextRef context = UIGraphicsGetCurrentContext();

I replaced UIRectFill(selectionRect) with CGContextFillRect(context, 
selectionRect);

But I still get the errors, and nothing is drawn.



- Koen.
___

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: CTLineGetTypographicBounds crash

2013-05-22 Thread Koen van der Drift

On May 22, 2013, at 10:16 AM, Koen van der Drift koenvanderdr...@gmail.com 
wrote:

 I now get a bunch of Error: CGContextFillRects: invalid context 0x0 errors, 
 which makes sense since this snippet does not have something like:
 
CGContextRef context = UIGraphicsGetCurrentContext();
 
 I replaced UIRectFill(selectionRect) with CGContextFillRect(context, 
 selectionRect);
 
 But I still get the errors, and nothing is drawn.


Easy fix, I had to call - (void)drawRangeAsSelection:(NSRange)selectionRange 
from within drawRect.

- Koen.


___

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: Jiggling Shadow Offset

2013-05-22 Thread Gordon Apple
How are you forcing the redraw?  If you are using setNeedsDisplayInRect:,
are you expanding the rect enough to cover the shadow?


On 5/22/13 4:34 AM, cocoa-dev-requ...@lists.apple.com
cocoa-dev-requ...@lists.apple.com wrote:

 What bit of obviousness am I missing here?
 http://www.sethwillits.com/temp/ShadowOffset.mov


___

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: Cocoa-dev Digest, Vol 10, Issue 307

2013-05-22 Thread Robert Clair
NSData *source  = // whatever
NSRange  myRange = // whatever

NSData *subrangeOfSource = [source subdataWithRange: myRange];


On May 18, 2013, at 3:00 PM, cocoa-dev-requ...@lists.apple.com 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: Trigger nextkeyview based on NSTextField input length
  (Jaime Magiera)
   2. UIView embedded in UIScrollView hides scroll indicators ?
  (Koen van der Drift)
   3. Re: UIView embedded in UIScrollView hides scroll indicators ?
  (Marcelo Alves)
   4. Re: UIView embedded in UIScrollView hides scroll indicators ?
  (Koen van der Drift)
   5. Re: UIView embedded in UIScrollView hides scroll indicators ?
  (David Duncan)
 
 
 --
 
 Message: 1
 Date: Sat, 18 May 2013 00:53:24 -0400
 From: Jaime Magiera ja...@sensoryresearch.net
 To: CocoaDev dev cocoa-dev@lists.apple.com
 Subject: Re: Trigger nextkeyview based on NSTextField input length
 Message-ID: ec829b09-95d2-4531-88bf-afa0ddf19...@sensoryresearch.net
 Content-Type: text/plain; charset=us-ascii
 
 On May 17, 2013, at 11:03 PM, Kyle Sluder k...@ksluder.com wrote:
 
 So rather than the four-field approach, why not use _one_ text field with an 
 NSFormatter subclass that adds and removes the dashes in the license code? 
 Then you get all the text handling behavior users expect for free.
 
 
 Very wise. Thanks Kyle. 
 
 Jaime Magiera
 
 Sensory Research, Inc.
 http://www.sensoryresearch.net
 
 
 
 --
 
 Message: 2
 Date: Sat, 18 May 2013 13:43:02 -0400
 From: Koen van der Drift koenvanderdr...@gmail.com
 To: Cocoa Dev cocoa-dev@lists.apple.com
 Subject: UIView embedded in UIScrollView hides scroll indicators ?
 Message-ID:
   CAF8z=hdb4mga6wiea3stj_6yp_c-01jr18cv6c1235ncxfe...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8
 
 In IB I created an UIView embedded in an UIScrollView. They both fill up
 the screen and are 320 px wide.  Scrolling works just fine, but the scroll
 indicators are invisible. I triple checked the checkboxes in IB, and both
 Scrolling Enabled and Shows Vertical Scrollers are on.  To be super
 sure I added this to my VC:
 
self.scrollView.scrollEnabled = YES;
 
self.scrollView.showsVerticalScrollIndicator = YES;
 
 I tried making the UIView a little less wide (300px), but I still don't see
 the scroll indicators.
 
 What did I miss to make them appear?
 
 Thanks,
 
 - Koen.
 
 
 --
 
 Message: 3
 Date: Sat, 18 May 2013 14:50:19 -0300
 From: Marcelo Alves marcelo.al...@me.com
 To: Cocoa Dev cocoa-dev@lists.apple.com
 Subject: Re: UIView embedded in UIScrollView hides scroll indicators ?
 Message-ID: d96ff59d-bb48-4e31-b8c7-be1a50c0d...@me.com
 Content-Type: text/plain; charset=us-ascii
 
 
 Did you forgot to set the contentSize for the UIScrollView? 
 
 
 On 18/05/2013, at 14:43, Koen van der Drift koenvanderdr...@gmail.com wrote:
 
 In IB I created an UIView embedded in an UIScrollView. They both fill up
 the screen and are 320 px wide.  Scrolling works just fine, but the scroll
 indicators are invisible. I triple checked the checkboxes in IB, and both
 Scrolling Enabled and Shows Vertical Scrollers are on.  To be super
 sure I added this to my VC:
 
   self.scrollView.scrollEnabled = YES;
 
   self.scrollView.showsVerticalScrollIndicator = YES;
 
 I tried making the UIView a little less wide (300px), but I still don't see
 the scroll indicators.
 
 What did I miss to make them appear?
 
 Thanks,
 
 - Koen.
 
 
 
 
 --
 
 Message: 4
 Date: Sat, 18 May 2013 14:28:18 -0400
 From: Koen van der Drift koenvanderdr...@gmail.com
 To: Marcelo Alves marcelo.al...@me.com
 Cc: Cocoa Dev cocoa-dev@lists.apple.com
 Subject: Re: UIView embedded in UIScrollView hides scroll indicators ?
 Message-ID:
   CAF8z=heusyktzny_uye-12cwbrqn4jh7hzepncudtoxaa+2...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8
 
 Yes, I did, but I may have made a mistake. I have this in viewDidLoad:
 
 self.scrollView.contentSize = CGSizeMake(320, self.myView.frame.size.height
 + self.tabBarController.tabBar.frame.size.height);
 
 I also found that if I add either
 
 self.scrollView.bounds = self.view.bounds;  or  self.scrollView.frame =
 self.view.frame;
 
 I do see the scrollbar, but the content myView is cut off on the right
 side.
 
 
 So, then I decided to ditch my XIB and to create the two views in my VC,
 and presto, it works!
 
 - Koen.
 
 
 On Sat, 

ImageKit: what format does memory mode on 10.7 use?

2013-05-22 Thread Eric Slosser
When I use memory transfer mode on 10.8 , ImageKit calls my 
scannerDevice:didScanToURL:data: with an NSData object containing TIFF data 
that can be used with +[NSBitmapImageRep initWithData:].

When I try the same thing on 10.7, the NSData isn't TIFF, it looks like this:

$ hexdump -C -n 256  ~/Desktop/Canon-MG4220mystery 
  70 00 00 00 01 00 00 00  f0 09 00 00 e7 0c 00 00  |p...|
0010  d0 1d 00 00 01 00 00 00  08 00 00 00 18 00 00 00  ||
0020  01 00 00 00 00 00 00 00  01 00 00 00 2c 01 00 00  |,...|
0030  73 63 61 6e 6e 65 72 2e  72 65 66 6c 65 63 74 69  |scanner.reflecti|
0040  76 65 2e 52 47 42 2e 70  6f 73 69 74 69 76 65 00  |ve.RGB.positive.|
0050  ee ee ed f0 ee ed ed ef  ee ef ee ee f0 ed ed ef  ||
0060  ed ea e9 f0 ed ed ee ee  ef ef ed ee ec eb f0 eb  ||
0070  21 20 22 21 20 22 20 1f  22 23 23 22 22 20 22 23  |! !  .## #|
0080  24 23 24 25 23 27 2a 2b  53 53 4d a6 9e 9d dc dd  |$#$%#'*+SSM.|
0090  df ea e7 e7 ea ea e9 ea  eb eb eb eb ef ea ed eb  ||
00a0  ed eb ea eb eb e9 ea ea  ea eb ea ec ec ed ec ed  ||
00b0  ea ec ec ec ec ed ea eb  ee eb eb e9 ea eb ed ed  ||
00c0  ec ef eb eb ed ed ed ec  ea ed eb eb eb eb ed ec  ||
00d0  ee e9 ea e6 e4 eb ed ea  ec ec eb ed ee ea ec ef  ||
00e0  eb ec ed eb ea ec ea ed  eb e9 eb ec eb ed ed ee  ||
00f0  ee ef ed ec ee ec ec ef  eb ed ee ec ed ee ea ea  ||

What format is this?  

Or better, How can I tell ImageKit that I want TIFF data?

Thanks in advance!
___

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


Springboard crash in BulletinBoard while app posts local notifications

2013-05-22 Thread Fritz Anderson
iPhone 4, iOS 6.1.3, and
iPhone 5, OS unknown, can assume 6.1.+ and likely 6.1.3
iOS 6 SDK, iOS 6 target
Two users, one instance each, can't reproduce on iPhone 4, iPhone 5, or 
simulator.

Okay, here's what we're seeing.

We have an application that posts local notifications, about a dozen at a time.

We have a crash that has occurred only once for two users, and never 
reproduced, certainly not under a debugger. At about the time the notifications 
are posted (at a -viewDidLoad), and before the view appears, the device resets 
(at least to the extent of displaying the shiny-apple screen).

The app does not appear in the device crash logs. Springboard does log a crash 
at that time; I would guess that if Springboard crashed, there would be a reset 
of some kind.

The reasons I suspect notifications are:

* The timing is right for what the app is doing.
* We find the following trace for the crashed thread in Springboard:

Thread 18 name:  Dispatch queue: com.apple.bulletinboard.bbserverqueue
Thread 18 Crashed:
0   libsystem_kernel.dylib0x398e5350 __pthread_kill + 8
1   libsystem_c.dylib 0x3985c11e pthread_kill + 54
2   libsystem_c.dylib 0x3989896e abort + 90
3   libc++abi.dylib   0x38e36d4a abort_message + 70
4   libc++abi.dylib   0x38e33ff4 default_terminate() + 20
5   libobjc.A.dylib   0x393e7a74 _objc_terminate() + 144
6   libc++abi.dylib   0x38e34078 safe_handler_caller(void (*)()) + 
76
7   libc++abi.dylib   0x38e34110 std::terminate() + 16
8   libc++abi.dylib   0x38e3550e __cxa_throw + 118
9   libobjc.A.dylib   0x393e79ba objc_exception_throw + 90
10  CoreFoundation0x3168c8d4 -[__NSArrayM 
insertObject:atIndex:] + 764
11  BulletinBoard 0x3432d30e -[BBServer 
_feedsForBulletin:destinations:alwaysToLockScreen:] + 426
12  BulletinBoard 0x3432b630 -[BBServer 
publishBulletin:destinations:alwaysToLockScreen:] + 80
13  BulletinBoard 0x3433f8e8 -[BBServer(Publication) 
publishBulletinRequest:destinations:alwaysToLockScreen:] + 1416
14  BulletinBoard 0x34333ae4 -[BBServer 
_publishBulletinRequest:forDataProvider:forDestinations:alwaysToLockScreen:] + 
56
15  BulletinBoard 0x34333aa2 -[BBServer 
_publishBulletinRequest:forDataProvider:forDestinations:] + 26
16  BulletinBoard 0x343320e2 
__BBDataProviderAddBulletin_block_invoke_0 + 94
17  libdispatch.dylib 0x397ff11c _dispatch_call_block_and_release + 
8

So -[BBServer _feedsForBulletin:destinations:alwaysToLockScreen:] tried to 
insert an object in a mutable array. Either the object or the index were 
invalid. NSMutableArray threw an exception, nobody caught it, and Springboard 
aborted.

There is very little on the web (other than a classdump) about crashes in 
BBServer, which I gather implements local notifications. 

We've found nothing remarkable in the device that hosted the crash. The user 
had since uninstalled and reinstalled the app. (Would that delete its crash 
logs?) The Notification Center settings as we found them (after installation) 
was in-center, banner, sounds, badges, in lock screen.

Here's the post (it's in a loop of about a dozen items):


self.localNotification = [[UILocalNotification alloc] init];
[self.localNotification setFireDate:self.dateScheduled];
[self.localNotification setAlertBody:self.itemTitle];
[self.localNotification setApplicationIconBadgeNumber:1];
[self.localNotification setTimeZone:[NSTimeZone systemTimeZone]];
[[UIApplication sharedApplication] scheduleLocalNotification:[self 
localNotification]];


I don't see anything unusual. Some stackoverflow threads talk about putting 
non-NSCoding objects into the userInfo dictionary, but we don't touch that all.

If we're debugging Springboard, we're in trouble. But Apple probably runs 
Springboard before releasing an iOS revision, so a bug there is extremely 
unlikely.

— F
-- 
Fritz Anderson
Xcode 4 Unleashed: 4.5 supplement for free!
http://www.informit.com/store/xcode-4-unleashed-9780672333279


___

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

Showing a popover from an NSOutlineView

2013-05-22 Thread Steve Mills
Rather than try to get an NSPopUpMenu to work by displaying a window instead of 
the menu, I'm going down the path of using an NSPopover instead. It allows 
multiple events in the window and can dismiss when the user clicks somewhere 
else. Great. Now I *also* need to display this popover from a cell in an 
outline view. Previously, the cell that used to display this window was a 
subclass of NSPopUpButtonCell. The cell needs to *look* like a popup cell with 
the name on the left and popup triangle on the right. I get the feeling that I 
should not keep using an NSPopUpButtonCell for this, because it will run into 
the same issues that I was trying to work around before. So is it possible to 
use some other NSCell class and embed an NSPopUpButtonCell inside of it just so 
it can do the drawing, but allow me to handle the mouse tracking so I can show 
the popover instead? Or is there another way to draw a popup triangle? It 
doesn't look like an outline view cell can be an NSButtonCell.

Any guidance would be appreciated, as this entire window is overly complex and 
I'm about to go insane.

--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157



___

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: Showing a popover from an NSOutlineView

2013-05-22 Thread Alex Zavatone
I've got a simple case for iOS that I can send you where I issue an 
UIPopoverController and a PopoverContentViewController from a UIButton in a 
UINavigationBar.

Sounds like you're trying to do this in the Mac, but if you think it will help, 
I'll strip the project down to the minimum and send your way.  Will work on iOS 
5 and up, Xcode 4.2 and up.

As for retheme-ing the border for the popover, haven't tried that yet.  If you 
need some close to accurate triangles, I can get those for you and you can put 
them in a UIImageView over the button.

Let me know.

On May 22, 2013, at 5:03 PM, Steve Mills wrote:

 Rather than try to get an NSPopUpMenu to work by displaying a window instead 
 of the menu, I'm going down the path of using an NSPopover instead. It allows 
 multiple events in the window and can dismiss when the user clicks somewhere 
 else. Great. Now I *also* need to display this popover from a cell in an 
 outline view. Previously, the cell that used to display this window was a 
 subclass of NSPopUpButtonCell. The cell needs to *look* like a popup cell 
 with the name on the left and popup triangle on the right. I get the feeling 
 that I should not keep using an NSPopUpButtonCell for this, because it will 
 run into the same issues that I was trying to work around before. So is it 
 possible to use some other NSCell class and embed an NSPopUpButtonCell inside 
 of it just so it can do the drawing, but allow me to handle the mouse 
 tracking so I can show the popover instead? Or is there another way to draw a 
 popup triangle? It doesn't look like an outline view cell can be an 
 NSButtonCell.
 
 Any guidance would be appreciated, as this entire window is overly complex 
 and I'm about to go insane.
 
 --
 Steve Mills
 office: 952-818-3871
 home: 952-401-6255
 cell: 612-803-6157
 
 
 
 ___
 
 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/zav%40mac.com
 
 This email sent to z...@mac.com


___

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: Showing a popover from an NSOutlineView

2013-05-22 Thread Steve Mills
On May 22, 2013, at 16:15:31, Alex Zavatone z...@mac.com
 wrote:

 I've got a simple case for iOS that I can send you where I issue an 
 UIPopoverController and a PopoverContentViewController from a UIButton in a 
 UINavigationBar.
 
 Sounds like you're trying to do this in the Mac, but if you think it will 
 help, I'll strip the project down to the minimum and send your way.  Will 
 work on iOS 5 and up, Xcode 4.2 and up.

Yes, OS X, not iOS. If your case doesn't involve an outline view or table view, 
I don't think it will be of much help. I already have code to show a popover 
from a button. I'm asking about showing a popover from a call in an outline 
view.

 As for retheme-ing the border for the popover, haven't tried that yet.  If 
 you need some close to accurate triangles, I can get those for you and you 
 can put them in a UIImageView over the button.

I'm not retheming the popover. I asked about drawing a popup triangle.

--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157



___

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: Showing a popover from an NSOutlineView

2013-05-22 Thread Jonathan Hull
Have you considered subclassing NSPopupButtonCell and overriding the 
interaction code?  The alternative would be to subclass NSCell (or an 
appropriate subclass) and override the drawing methods.  For the triangle, you 
could either use an image, or preferably, measure the dimensions and draw it 
using a CGPath.

You may also want to consider a view-based outline view, as it is a bit easier 
to work with, and will be easier to show a popover from.

Finally, from an interaction design perspective, you may want your cell/view to 
look a bit different than a NSPopupButtonCell, as things which behave 
differently should look different.

Thanks,
Jon

On May 22, 2013, at 2:19 PM, Steve Mills smi...@makemusic.com wrote:

 On May 22, 2013, at 16:15:31, Alex Zavatone z...@mac.com
 wrote:
 
 I've got a simple case for iOS that I can send you where I issue an 
 UIPopoverController and a PopoverContentViewController from a UIButton in a 
 UINavigationBar.
 
 Sounds like you're trying to do this in the Mac, but if you think it will 
 help, I'll strip the project down to the minimum and send your way.  Will 
 work on iOS 5 and up, Xcode 4.2 and up.
 
 Yes, OS X, not iOS. If your case doesn't involve an outline view or table 
 view, I don't think it will be of much help. I already have code to show a 
 popover from a button. I'm asking about showing a popover from a call in an 
 outline view.
 
 As for retheme-ing the border for the popover, haven't tried that yet.  If 
 you need some close to accurate triangles, I can get those for you and you 
 can put them in a UIImageView over the button.
 
 I'm not retheming the popover. I asked about drawing a popup triangle.
 
 --
 Steve Mills
 office: 952-818-3871
 home: 952-401-6255
 cell: 612-803-6157
 
 
 
 ___
 
 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/jhull%40gbis.com
 
 This email sent to jh...@gbis.com
 


___

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: Showing a popover from an NSOutlineView

2013-05-22 Thread Alex Zavatone
Yeah, if you need the triangle, I can toss you an Illustrator file or a PNG so 
that you can just add a UIImage to the button.

On May 22, 2013, at 5:19 PM, Steve Mills wrote:

 On May 22, 2013, at 16:15:31, Alex Zavatone z...@mac.com
 wrote:
 
 I've got a simple case for iOS that I can send you where I issue an 
 UIPopoverController and a PopoverContentViewController from a UIButton in a 
 UINavigationBar.
 
 Sounds like you're trying to do this in the Mac, but if you think it will 
 help, I'll strip the project down to the minimum and send your way.  Will 
 work on iOS 5 and up, Xcode 4.2 and up.
 
 Yes, OS X, not iOS. If your case doesn't involve an outline view or table 
 view, I don't think it will be of much help. I already have code to show a 
 popover from a button. I'm asking about showing a popover from a call in an 
 outline view.
 
 As for retheme-ing the border for the popover, haven't tried that yet.  If 
 you need some close to accurate triangles, I can get those for you and you 
 can put them in a UIImageView over the button.
 
 I'm not retheming the popover. I asked about drawing a popup triangle.
 
 --
 Steve Mills
 office: 952-818-3871
 home: 952-401-6255
 cell: 612-803-6157
 
 


___

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: NSMutableDictionary or Custom Object when adding properties?

2013-05-22 Thread Christ Levesque
Howdy,

It's very easy to do using runtime. I have a framework for doing dynamic 
creation at runtime. Also, It's easy to get O-C based class elements such as 
properties, ivars, protocols. methods using runtime. You can take a look at 
this.
https://gist.github.com/Ch0c0late/5575679 It introspects protocol conformed by 
a class  also it could add new protocol to the class. The rest of the code is 
on my local. You can feel free using it. It's part of a SCK framework. If you 
need more type e.g. methods, properties,  etc, you can take a look at my 
framework. I'm coding an OODBMS for OS X that uses O-C runtime so much. Again 
using runtime it's easy. How?
First of all the system creates an empty array. Then the user can create any 
type of object he/she wants without any limit. For archiving  unarchiving I 
used Boxing  UnBoxing classes(NSNumber, NSValue, NSNull) that let me to 
archive c primitive types and so on. There is s.t. interesting that could be 
your answer. Take a look at this one 
https://github.com/snej/MYUtilities/blob/master/MYDynamicObject.h It's a good 
class that you can use to create dynamic object at runtime. I added Archiving  
UnArchiving mechanism to it for my own. Please note that in 64 bit system there 
is no need to declare iVars. The runtime acts as iVar  property with property. 

Down the hatch.
___

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


Creating More Than 1 Of The Same Element/control

2013-05-22 Thread Harmony Neil
Hellow,
I've been working through a couple of tutorials and managed to make a text 
field and things just fine.  The thing I'm wondering is how do I go about 
naming the textField what I want to call it, like textField1 or for example 
rather than just textField?  Also, how do I make more than 1 textField?  I 
would just use the same code as for the first one and change the y co-ordinate, 
but then I would still want to call them all something other than textField.
I'm using the objective c language and hate using the storyboard and interface 
builder.  If I'm going to code something, I'll write the code by hand.  I tried 
posting on the objc language list, but the only person who replied seemed to 
think it was too beginner level and that I was posting on the wrong list.  If 
no one on here can help me rather than insist on suggesting stupid books, I 
don't really know where else to ask, since I'm not getting a lot of luck on 
google's search results.
Thanks,
Harmony.
___

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


Dismissing The Keyboard

2013-05-22 Thread Harmony Neil
Hellow,
I'm using the numberpad for entering text in the textFields in my iPhone app 
which is fine, but for some reason I've resigned firstResponder to all the 
textFields so I can dismiss the keyboard when I press the calculate button, but 
when I press said button, the keyboard just stays on the screen.
Does anyone know what is the best way of dismissing the keyboard?  I preferably 
want to dismiss the keyboard for whichever of the 3 textFields I'm writing in.  
Also, I've called my textFields txt1, txt2 and txt3 to make it easier, but I 
had to put an _ character when I wrote the resignFirstResponder lines for the 
app to even build and run.
Thanks for any help/suggestions,
Harmony.
___

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: Dismissing The Keyboard

2013-05-22 Thread Andreas Liebschner
On Wed, May 22, 2013 at 1:34 PM, Harmony Neil harmony.n...@gmail.com wrote:

 Does anyone know what is the best way of dismissing the keyboard?
 I preferably want to dismiss the keyboard for whichever of the 3 textFields 
 I'm writing
 in.

Hello,

Give UIView's endEditing: method a try. Here is the doc (shortened
with google since Apple's doc URL are kinda messy):
http://goo.gl/Cs2Pw

You'd basically call it on the UIView containing these text fields.

PS: objc-language should not be used for email messages like this.
cocoa-dev is fine.

Andreas
___

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: Managing navigation in an iOS app

2013-05-22 Thread Thomas Davie
Hi James,

I'd suggest that you're probably pushing the idea of decoupling things a bit 
too far here.

View Controllers are inherantly tied to the behaviour of your application, and 
your user's experience of the flow through it.  In 95% of cases, it's 
absolutely correct for the view controller to know the user pushed this 
button, therefore I should show them this other view controller.

For the 5% of remaining cases where (for example) you have a highly reusable 
view controller that gets used in many different places in the app, and may 
push a different child VC depending on its usage location, I'd suggest simply 
using a delegate to that particular VC to allow you to separate out what gets 
pushed.

Thanks

Tom Davie

On 21 May 2013, at 20:56, j...@clvr.im wrote:

 I'd like to get some opinions on handling navigation without having
 your view controllers modify the navigation stack directly.
 I'm currently working on an app where I've subclassed
 UINavigationController, which in turn has custom methods for showing
 the various views of the app. Each of my app's view controllers has no
 sense of the other pieces of the app, and do not push directly on the
 navigation controller. I'm thinking this a much better method since it
 decouples view controllers from each other and allows the flow of the
 app to be updated more easily.
 I'm using a lot of NSNotifications to signal commands to the
 navigation controller, and it's getting a bit messy. I love the idea
 of a centralized, decoupled navigation controller, but I haven't seen
 any good examples of this yet.
 I would love to get some feedback as to if this is a good idea in the
 first place, or techniques you've implemented to handle this sort of
 thing.
 
 Cheers,
 
 James
 ___
 
 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/tom.davie%40gmail.com
 
 This email sent to tom.da...@gmail.com


___

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: Dismissing The Keyboard

2013-05-22 Thread Hunter Hillegas
Take a look at [UIView endEditing].

On May 22, 2013, at 4:34 AM, Harmony Neil harmony.n...@gmail.com wrote:

 I preferably want to dismiss the keyboard for whichever of the 3 textFields 
 I'm writing in.

___

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: ImageKit: what format does memory mode on 10.7 use?

2013-05-22 Thread Eric Slosser
This is reported as rdar://13966809

On May 22, 2013, at 3:24 PM, Eric Slosser eric.slos...@v-fx.com wrote:

 When I use memory transfer mode on 10.8 , ImageKit calls my 
 scannerDevice:didScanToURL:data: with an NSData object containing TIFF data 
 that can be used with +[NSBitmapImageRep initWithData:].
 
 When I try the same thing on 10.7, the NSData isn't TIFF, it looks like this:
 
 $ hexdump -C -n 256  ~/Desktop/Canon-MG4220mystery 
   70 00 00 00 01 00 00 00  f0 09 00 00 e7 0c 00 00  |p...|
 0010  d0 1d 00 00 01 00 00 00  08 00 00 00 18 00 00 00  ||
 0020  01 00 00 00 00 00 00 00  01 00 00 00 2c 01 00 00  |,...|
 0030  73 63 61 6e 6e 65 72 2e  72 65 66 6c 65 63 74 69  |scanner.reflecti|
 0040  76 65 2e 52 47 42 2e 70  6f 73 69 74 69 76 65 00  |ve.RGB.positive.|
 0050  ee ee ed f0 ee ed ed ef  ee ef ee ee f0 ed ed ef  ||
 0060  ed ea e9 f0 ed ed ee ee  ef ef ed ee ec eb f0 eb  ||
 0070  21 20 22 21 20 22 20 1f  22 23 23 22 22 20 22 23  |! !  .## #|
 0080  24 23 24 25 23 27 2a 2b  53 53 4d a6 9e 9d dc dd  |$#$%#'*+SSM.|
 0090  df ea e7 e7 ea ea e9 ea  eb eb eb eb ef ea ed eb  ||
 00a0  ed eb ea eb eb e9 ea ea  ea eb ea ec ec ed ec ed  ||
 00b0  ea ec ec ec ec ed ea eb  ee eb eb e9 ea eb ed ed  ||
 00c0  ec ef eb eb ed ed ed ec  ea ed eb eb eb eb ed ec  ||
 00d0  ee e9 ea e6 e4 eb ed ea  ec ec eb ed ee ea ec ef  ||
 00e0  eb ec ed eb ea ec ea ed  eb e9 eb ec eb ed ed ee  ||
 00f0  ee ef ed ec ee ec ec ef  eb ed ee ec ed ee ea ea  ||
 
 What format is this?  
 
 Or better, How can I tell ImageKit that I want TIFF data?


___

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: Dismissing The Keyboard

2013-05-22 Thread Marcus Staloff

Do you also have the text field hooked up to File Owner's delegate?
That needs to be done to dismiss KB.

On May 22, 2013, at 7:34 AM, Harmony Neil harmony.n...@gmail.com wrote:

 Hellow,
 I'm using the numberpad for entering text in the textFields in my iPhone app 
 which is fine, but for some reason I've resigned firstResponder to all the 
 textFields so I can dismiss the keyboard when I press the calculate button, 
 but when I press said button, the keyboard just stays on the screen.
 Does anyone know what is the best way of dismissing the keyboard?  I 
 preferably want to dismiss the keyboard for whichever of the 3 textFields I'm 
 writing in.  Also, I've called my textFields txt1, txt2 and txt3 to make it 
 easier, but I had to put an _ character when I wrote the resignFirstResponder 
 lines for the app to even build and run.
 Thanks for any help/suggestions,
 Harmony.
 ___
 
 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/mstaloff%40verizon.net
 
 This email sent to mstal...@verizon.net


___

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: Creating More Than 1 Of The Same Element/control

2013-05-22 Thread Graham Cox

On 18/05/2013, at 8:21 PM, Harmony Neil harmony.n...@gmail.com wrote:

 I've been working through a couple of tutorials and managed to make a text 
 field and things just fine.  The thing I'm wondering is how do I go about 
 naming the textField what I want to call it, like textField1 or for example 
 rather than just textField?  Also, how do I make more than 1 textField?  I 
 would just use the same code as for the first one and change the y 
 co-ordinate, but then I would still want to call them all something other 
 than textField.
 I'm using the objective c language and hate using the storyboard and 
 interface builder.  If I'm going to code something, I'll write the code by 
 hand.  I tried posting on the objc language list, but the only person who 
 replied seemed to think it was too beginner level and that I was posting on 
 the wrong list.  If no one on here can help me rather than insist on 
 suggesting stupid books, I don't really know where else to ask, since I'm not 
 getting a lot of luck on google's search results.


Stick with Interface Builder, even if you don't enjoy it right now. You'll come 
to appreciate it even if it will perhaps never be love.

All you need to do is to create a separate IBOutlet in the controller for each 
field, then connect that to the fields in IB. In code, you can refer to the 
outlet by whatever name you called it, like any other instance variable.


@interface MyController : UIViewController
{
IBOutlet UITextField*   mTextField1;
IBOutlet UITextField*   mTextField2;


}


@end


in the code


[mTextField1 setStringValue:@blah blah];
[mTextField2 setStringValue:@hubba hubba];


Trying to do the set up of this kind of thing in code is possible, but never a 
very good idea. It is certainly the sign of a beginner to want to do that; 
you'd really be much better off using the time to get more familiar with IB. It 
will truly save you a monumental amount of work and will eliminate many 
irritating typical bugs.

I infer that you're working in iOS, rather than Mac, but I might have got the 
class names wrong above. I'm sure you're smart enough to realise if that's the 
case.

--Graham


___

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: Creating More Than 1 Of The Same Element/control

2013-05-22 Thread Thomas Davie

On 18 May 2013, at 03:21, Harmony Neil harmony.n...@gmail.com wrote:

 Hellow,
 I've been working through a couple of tutorials and managed to make a text 
 field and things just fine.  The thing I'm wondering is how do I go about 
 naming the textField what I want to call it, like textField1 or for example 
 rather than just textField?  Also, how do I make more than 1 textField?  I 
 would just use the same code as for the first one and change the y 
 co-ordinate, but then I would still want to call them all something other 
 than textField.
 I'm using the objective c language and hate using the storyboard and 
 interface builder.  If I'm going to code something, I'll write the code by 
 hand.  I tried posting on the objc language list, but the only person who 
 replied seemed to think it was too beginner level and that I was posting on 
 the wrong list.  If no one on here can help me rather than insist on 
 suggesting stupid books, I don't really know where else to ask, since I'm not 
 getting a lot of luck on google's search results.
 Thanks,
 Harmony.


Hi Harmony,

I'd really very strongly suggest that you just use Interface Builder.  Your 
user interface is essentially data, not code.  I doubt (and hope) very much 
that you don't write code to fill up a buffer with image data at runtime, 
rather than storing images in data files.  The same logic applies to your UI – 
store your archived objects in a nib file, and use IB to edit them.

Thanks

Tom Davie


___

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: Dismissing The Keyboard

2013-05-22 Thread Alex Zavatone
This is what I use when using a UISearchBar in iOS.  

-(void)searchBarSearchButtonClicked:(UISearchBar *)aSearchBar {
[aSearchBar resignFirstResponder];
}

By using the _ char in front of your var, it looks like you're talking directly 
to the private instance.  If you have a textfield called txt1, does it work if 
you try this:

[self.txt1 resignFirstResponder];

??

Did you forget to synthesize your property?  I actually ran into that today in 
Xcode 4.6.1 but only because I had started to @synthesize some vars and I think 
Xcode was trying to predict how I wanted the class vars to be scoped.

On May 22, 2013, at 7:45 PM, Marcus Staloff wrote:

 
 Do you also have the text field hooked up to File Owner's delegate?
 That needs to be done to dismiss KB.
 
 On May 22, 2013, at 7:34 AM, Harmony Neil harmony.n...@gmail.com wrote:
 
 Hellow,
 I'm using the numberpad for entering text in the textFields in my iPhone app 
 which is fine, but for some reason I've resigned firstResponder to all the 
 textFields so I can dismiss the keyboard when I press the calculate button, 
 but when I press said button, the keyboard just stays on the screen.
 Does anyone know what is the best way of dismissing the keyboard?  I 
 preferably want to dismiss the keyboard for whichever of the 3 textFields 
 I'm writing in.  Also, I've called my textFields txt1, txt2 and txt3 to make 
 it easier, but I had to put an _ character when I wrote the 
 resignFirstResponder lines for the app to even build and run.
 Thanks for any help/suggestions,
 Harmony.
 ___
 
 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/mstaloff%40verizon.net
 
 This email sent to mstal...@verizon.net
 
 
 ___
 
 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/zav%40mac.com
 
 This email sent to z...@mac.com


___

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


Crash in CFPreferencesSetAppValue

2013-05-22 Thread tridiak
  

Hello. This piece of code causes CFPreferencesSetAppValue() to
crash: 

- (CFDictionaryRef) createBlockSaveData { 

 CFDictionaryRef
parent=[super createBlockSaveData]; 

 CFStringRef
keys[]={CFSTR(LinkBlockURL), CFSTR(LinkBlockDisplayName),
CFSTR(LinkBlockBrowser), CFSTR(BlockType), nil}; 

 CFTypeRef
values[]={url ? (__bridge CFTypeRef)(url) : CFSTR(null), 


displayName ? (__bridge CFTypeRef)(displayName) : CFSTR(null), 


browser ? (__bridge CFTypeRef)(browser) : CFSTR(null), 


CFSTR(LKBLockTypeURL), 

 nil}; 

 CFMutableDictionaryRef
d=CFDictionaryCreateMutableCopy(nil, 0, parent); 

 if (url) {for (int
t=0; t
___

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