Re: Definitive guide to custom modal presentation?

2019-02-01 Thread Jesse Armand
If you’re implementing a custom animation transition for your presentation, 
just follow this guide:

https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/CustomizingtheTransitionAnimations.html

The transition context object provides the container view that is involved in 
displaying the subviews during transition. Then because you seem to be looking 
for interactive animation driven by gestures, you can implement 
startInteractiveTransition(_:) on your custom animation controller that 
conforms to UIViewControllerInteractiveTransitioning.

That animation controller can implement the 
UIViewControllerTransitioningDelegate and be the transitioningDelegate.

I don’t know about setting up all of these with segues though. I’d recommend to 
just programatically create the view controllers.
On 13 Nov 2018, 6:46 AM +0800, Rick Mann , wrote:
> I'm having a really hard time finding a definitive guide to custom modal 
> presentations in iOS.
>
> Nothing I've found online over two days of searching seems correct.
>
> I'm using a Storyboard and want to wire a segue from a button to my view 
> controller. I want it to slide up partway from an edge of the screen, but 
> stop partway across (i.e. not fill the screen). In some orientations/devices, 
> I want it to come up from the bottom. In others, I want it to come in from 
> the right. When presented from the bottom, it should be draggable to reveal 
> more of the drawer (when presented from the right, it's on iPad and always 
> fits), so it needs a interruptible animation the user can scrub through.
>
> Apple's own videos show making a UIStoryboardSegue subclass and making that 
> the UIViewControllerTransitioningDelegate. It's not strictly necessary to 
> make a UIPresentationController subclass, as you can still provide the 
> UIViewControllerAnimatedTransitioning implementations when doing this. But I 
> can't seem to get iOS to ask my custom segue for a UIPresentationController; 
> the method to vend that is never called.
>
> I also can't figure out who's responsible for adding the view to the view 
> hierarchy, is it the UIPresentationController subclass or the 
> UIViewControllerAnimatedTransitioning implementation? Who should respond to 
> the various pan and tap gesture recognizers I'll inevitably need to install?
>
> I appreciate any guidance. Thanks!
>
> --
> Rick Mann
> rm...@latencyzero.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/armand.jesse%40gmail.com
>
> This email sent to armand.je...@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: Simulate touch event with cordinate?

2011-04-03 Thread Jesse Armand
I'm sorry, but my opinion remains.

If someone such as Stephen Hawking (which is not mentioned that people
like him are the users) would like to read with face gestures, he
would not use an iPhone. Not even an iPad.

Unless if there's an external device that could translate all of the
gestures that these people have into touch events on the iOS.

An iOS app for people without hands would still require the help of
another person to operate the OS.

On Sat, Apr 2, 2011 at 1:52 PM, Sherm Pendley sherm.pend...@gmail.com wrote:
 On Sat, Apr 2, 2011 at 7:29 AM, Jesse Armand mnemonic...@gmail.com wrote:

 But, my word of advice:
 People don't read PDFs with the gestures of their face or head. It's just 
 silly.

 Tell that to Stephen Hawking. There are cases where what seems silly
 to most of us are the only options one has left.

 sherm--

 --
 Cocoa programming in Perl:
 http://camelbones.sourceforge.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Simulate touch event with cordinate?

2011-04-02 Thread Jesse Armand
Then, you are explaining your problems incorrectly.

You're looking to handle the motion of the face, recognized by the
face recognition algorithm and captured by the camera. You can't find
that answer in the iOS SDK.

You need to implement your own algorithm to detect those movements and
convert it somehow to a group of points or rects in the screen, with
their paths of movement.

Once you obtained this path, then you can do something with it.

But, my word of advice:
People don't read PDFs with the gestures of their face or head. It's just silly.

Jesse Armand

(http://jessearmand.com)



On Sat, Apr 2, 2011 at 7:25 AM, Rikza Azriyan rikzaxtrms...@yahoo.com wrote:
 Thanks chase for your reply,
 Yes, i want to make an application like ibooks that the user can navigate the 
 page by swipe the screen, than
 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
 Will respond for that swipe...
 But in my case, i don't want to make that swipe with my finger...
 I want to make that swipe by my face
 So that i want to implement my facetracking algorithm on my iphone 
 4...detecting the face by frontcamera, and give the output result as the face 
 position cordinate.
 I'm going to use this cordinate as realtime dragging event on my PDF reader 
 as if the finger swiping in my screen. As ibooks did use finger for swipe...
 that what i want to do chase...

 I hope u understand my bad english :)
 Thx in advance

 Rikza Azriyan
 Student of Sriwijaya University
 Palembang, Indonesia

 Sent from my iPhone
 Provided by Telkomsel.

 On Apr 2, 2011, at 9:36 AM, Chase Latta chasela...@gmail.com wrote:

 Are you trying to achieve something like, in the iBooks example, the
 user can swipe their finger to change the page or press a 'next page'
 button and have the same animation occur?  If so then you need to
 write one function to handle the animation and call that in response
 to either a button push or a series of touch events.

 - (void)moveMyThingFrom:(CGPoint)a toPoint:(CGPoint)b;
 {
    // Put code here for the animation
 }

 // For button press
 - (IBAction)moveThingAcrossScreen:(id)sender;
 {
    CGPoint fromPoint = ...;
    CGPoint toPoint = ...;
    [self moveMyThingFrom:fromPoint toPoint:toPoint];
 }

 // For drag events you could do something like
 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
 {
    lastPoint = ... // Value stored somewhere
    CGPoint newPoint = ... // Calculated from event
    [self moveMyThingFrom:lastPoint toPoint:toPoint];
 }

 The main point is that you should not be performing your animations in
 your event handling code; this should be in separate methods that get
 called from your event handling code or wherever you need to call it.

 Is this what you were looking for?

 Chase

 On Fri, Apr 1, 2011 at 7:02 PM, Conrad Shultz
 con...@synthetiqsolutions.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 4/1/11 6:44 PM, Rikza Azriyan wrote:
 Sorry maybe you guys don't understand with my bad english..
 I said UIGestureRecognizer does'n do what i want because it's for 
 detecting/responding touch,gesture,tap etc that user did to the screen. 
 It's for respond the user interaction to the screen...
 In my case, i want to make that interaction. I want to make a touch event 
 without touching the screen, i want to make slide event without touching 
 it

 Could you explain WHY you want to do this?  Surely if your app takes a
 certain action in response to a gesture it would be easier to just
 trigger that action on demand.

 Don't know what your goal is, but at first read this sounds like the
 product of a very flawed application architecture.


 - --
 Conrad Shultz

 Synthetiq Solutions
 www.synthetiqsolutions.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (Darwin)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iD8DBQFNloOfaOlrz5+0JdURAmhwAJ9tvB7kMYsTq9oSeCNo0+Fm91/vHgCdGP4b
 5+O28EP12Ej/qBFMsO5omys=
 =evPd
 -END PGP SIGNATURE-
 ___

 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/chaselatta%40gmail.com

 This email sent to chasela...@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:
 http://lists.apple.com/mailman/options/cocoa-dev/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments

Core Data search optimization

2010-08-30 Thread Jesse Armand
Hello,

I can't seem to find any discussion about this, but I have this
question after I watched session 137 of WWDC about core data
optimization.

So, Melissa Turner advise to use = and  instead of BEGINSWITH, but
how do I do that with predicate substitution variables or formatted
predicate?

Let's use this example:
@franc = searchName AND searchName  @frand

What if @franc is the search keyword variable that is obtained from
the search bar text input?
How do I increment the suffix or the overall NSString variable?
___

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: Core Data search optimization

2010-08-30 Thread Jesse Armand
Never mind, I found the solution in DerivedProperty example.


On Mon, Aug 30, 2010 at 6:43 PM, Jesse Armand mnemonic...@gmail.com wrote:
 Hello,

 I can't seem to find any discussion about this, but I have this
 question after I watched session 137 of WWDC about core data
 optimization.

 So, Melissa Turner advise to use = and  instead of BEGINSWITH, but
 how do I do that with predicate substitution variables or formatted
 predicate?

 Let's use this example:
 @franc = searchName AND searchName  @frand

 What if @franc is the search keyword variable that is obtained from
 the search bar text input?
 How do I increment the suffix or the overall NSString variable?

___

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: cocoa-dev vs. Apple's dev forums?

2010-03-08 Thread Jesse Armand
 Mailing list over forum any day. Don't make me hunt a bunch of forums every 
 day! x lists, one convenient interface (Mail.app).

 But my biggest beef: a closed forum will not be indexed by Google. So even if 
 you pay up and the dev forum has a great answer, you will not find it using 
 Google.

 Gerd


I have to say, I agree with this opinion. It seems like I'm one of the
classic developers.

Jesse Armand

(http://jessearmand.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What is the best way to call parent view controller methods from within child view controller?

2009-09-20 Thread Jesse Armand
You can create an ivar in class B that refer to class A instance. Set
that ivar, when class B instance is created.
So, you can call the methods in class A by using that instance,
without searching through the view controllers array.

Besides, you can also change the title before class B is pushed.

You should not refer to the navigation controller's parent.
You should refer to the current view controller's parent.

self.parentViewController.navigationItem.title = @New Title

That's if the parentViewController is not nil.
I never used this property.


Jesse Armand

(http://jessearmand.com)



On Sun, Sep 20, 2009 at 3:34 AM, Alex Reynolds alexpreyno...@gmail.com wrote:
 I have a view hierarchy managed with UINavigationController, of the form A
 - B, where A and B are UIViewController subclasses.

 When I am in the B view, I have a backBarButtonItem in the navigation bar
 that will pop the application back to the A view, when selected.

 The title of the backBarButtonItem was initially set in A, just before I
 pushed the B view onto the navigation stack.

 Assuming I am in B and I would like to change the title of the
 backBarButtonItem, what is the best way to accomplish this?

 Currently, I have a method in A that sets the title property value:

        - (void) setBackBarButtonItemTitle:(NSString *)newTitle {
            self.navigationItem.backBarButtonItem.title = newTitle;
        }

 When in B, I call -viewControllers to get the array of view controllers,
 referencing the second to last element to call A's
 -setBackBarButtonItemTitle:

        NSArray *viewControllerArray = [self.navigationController
 viewControllers];
        int parentViewControllerIndex = [viewControllerArray count] - 2;
        [[viewControllerArray objectAtIndex:parentViewControllerIndex]
 setBackBarButtonItemTitle:@New Title];

 This approach is clunky but it seems to work correctly.

 However, I don't know why the following does not work, when called within B:

        [(A *)(self.navigationController.parentViewController)
 setBackBarButtonItemTitle:@New Title];

 In fact, calling any parent view methods using the parentViewController
 property does not work.

 Why does this second approach (using the parentViewController property) fail
 to work? Am I not using this property correctly?

 Thanks,
 Alex
 ___

 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What is the best way to call parent view controller methods from within child view controller?

2009-09-20 Thread Jesse Armand
On Sun, Sep 20, 2009 at 6:37 PM, Jesse Armand mnemonic...@gmail.com wrote:
 You can create an ivar in class B that refer to class A instance. Set
 that ivar, when class B instance is created.
 So, you can call the methods in class A by using that instance,
 without searching through the view controllers array.


Correction, it should be when the class B view controller is pushed.
___

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: Building a 64-bit Preferences Pane

2009-09-18 Thread Jesse Armand
I just realized that the dev forums for Mac is only available for
Select or Premier member of ADC, not the online member.

Do you mind to share the solution ?

Jesse Armand

(http://jessearmand.com)



2009/4/30 慧 松本 sato...@mac.com:
 Thanks!!

 My problem was resolved at  https://devforums.apple.com/community/mac

 Satoshi


 On 2009/04/30, at 12:59, Clark Cox wrote:

 2009/4/29 慧 松本 sato...@mac.com:

 On 2009/04/30, at 12:05, Andrew Farmer wrote:

 On 29 Apr 09, at 19:48, 慧 松本 wrote:

 Does anybody know how to make 64-bit preference panes?

 You can't, yet. The System Preferences application - which loads
 preference panes as plugins - is still 32-bit only, so it can't load
 64-bit
 prefpane plugins.

 Sorry, I forgot to mention my OS environment. I am developing the
 preference
 pane on Mac OS X 10.6 Snow Leopard build 10A335.
 Does my question violate NDA?

 Take it to https://devforums.apple.com/community/mac

 --
 Clark S. Cox III
 clarkc...@gmail.com

 -
 Satoshi Matsumoto sato...@mac.com
 816-5 Odake, Odawara, Kanagawa, Japan 256-0802




 ___

 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Building a 64-bit Preferences Pane

2009-09-18 Thread Jesse Armand
Okay thanks, I also found the solution from a blog somewhere while searching.

It's weird how Apple lay out all of the important things about 64-bit
in the docs, but left out this one somewhere that I couldn't find
easily.

I also ran the script to check for 64-bit compatibility, added the
proper #ifdef for it (it's only about data types).

2009/9/18 MATSUMOTO Satoshi sato...@mac.com:
 Hi,


 Building 64-bit Preferences Pane...
 In response to satoshi on Apr 30, 2009 2:21 PM
 I have been trying to make a simple 64-bit Preference Pane on Snow Leopard
 buid 10A335. But all trials ended in failure.

 For example:
        1) Make a new preference pane project SamplePrefPane with Xcode.
        2) Set the build option ARCHS to x86_64
        3) Build it and double click SamplePrefPane.prefPane

  ANSWER

 2.5)   turn on Garbage Collection.  (Search for garbage collection in
 build settings inspector)
 On Snow Leopard, System Preferences has garbage collection enabled when
 launched as a 64 bit application (default on 64 bit capable machines).
 If you intend on supporting both 32 bit and 64 bit machines, you'll need to
 build your preference pane as a dual mode module;  gc supported instead of
 gc only.
 Then System Preferences app says:
        Preferences Error
         You can't open SimplePrefPane preferences because
         it doesn't work on an Intel-based Mac.
 That is a horribly failure message.  Please file a bug via
 http://bugreporter.apple.com/.

 Satoshi



 Jesse Armand
 
 (http://jessearmand.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Jesse Armand
Mac Mini with 4 GB of RAM is definitely enough to develop iPhone apps.

The newest Mac Mini is already using NVIDIA graphics processor, Intel
Core 2 Duo, and up to 320 GB HDD.

You might need better Macs, if you're planning to build complex
software like computer simulation with heavy graphics processing or
hardcore games.

Jesse Armand

(http://jessearmand.com)



On Mon, Sep 14, 2009 at 2:53 AM, Michael Rogers mprog...@mac.com wrote:
 Hi, All:

 I've been given a short deadline for choosing between a Mac Mini or iMac for
 Cocoa development (especially iPhone apps) at a university that will remain
 nameless unless you read my signature :-)

 I am leaning towards iMacs, because these computers will serve as
 ambassadors as well as development machines;  I want to double-check that if
 we have to go to Mac Minis, say with 4 GB of RAM, we won't be waiting
 forever to compile a simple program.

 Either responses to the list or to me privately would be great.

 Thanks,

 Michael
 --
 Dr. Michael Rogers
 Commercial Pilot  Damfino
 Assistant Professor, Computer Science  Information Systems
 Northwest Missouri State University
 Cell:  309-825-6454;  Work:  660-562-1551;  IM:  mprog...@mac.com

 24-hour laundry?  I don't have that kind of 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa-dev Digest, Vol 6, Issue 1304

2009-09-12 Thread Jesse Armand
Read the data into NSDate object, and compare it with
timeIntervalSinceDate: method.

This way, you'll get the time interval in seconds and then convert it
to unit of days.

Jesse Armand

(http://jessearmand.com)



On Sat, Sep 12, 2009 at 6:25 PM, Rajashekhar Managoli
raj.mang...@gmail.com wrote:
 Hi All,

 I am new to Objective C and COCOA and Iphone Delopment

 I am reading two dates from UIDatepicker i want find the diffrence between
 to days

 say 12/09/2009  in DDMM format 16/09/2009 DDMM for and finde the
 number of days in between.

 Thnaks in advance

 Regards
 Raj
 ___

 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


The correct NSPredicate format for one-to-many relationship in Core Data

2009-07-25 Thread Jesse Armand
Hello,

I have a managed object model entities A and B with one-to-many relationship.

For this particular task, I want to retrieve all A objects which has a
relation to B with a property matches to string.

I had tried @ALL bObjects.bProperty MATCHES 'string', and it caused
an objc_exception_throw in:

[NSSQLGenerator
generateSQLStatementForFetchRequest:ignoreInheritance:countOnly:]

What seems to be the problem ?

Anybody can advise me on the correct predicate format ?

Jesse Armand

(http://jessearmand.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPhone List? - few questions

2009-07-24 Thread Jesse Armand
I suppose mobile banking is less secure than regular internet banking ?

I'm not sure what is the weakness in mobile banking, compared to
regular internet banking, where both of them have a secure device to
generate code for transactions ?

Let's say somebody stole your phone, what can he/she do without the
secure device that's registered to your bank account ?

Jesse Armand

(http://jessearmand.com)



On Fri, Jul 24, 2009 at 8:12 AM, Roland Kingr...@rols.org wrote:
 Well you can't register to listen to SMSes, that hook just doesn't exist. So
 if you rely on proving who someone is by sending something to a specific
 phone (ie making use of the telephone companys vast network ability to
 locate one device with that particular SIM card in it at that point in time
 anywhere in the world), SMS is kind of about the only way to do it.

 I took a look to see what happens when you're running an app and an SMS
 comes in, with a URL on it . it's not totally pretty, you get to option to
 'reply', which closes your app, or 'close' which closes the SMS. So the best
 you could do like that is hit reply, close your app, hit the link in the SMS
 which opens it up again, you'd need a quick-start app for that.

 The only other way is to have done the SMS thing way in advance and cached a
 token on the phone you use at the time direct to the server, but that's not
 very good security, the token would go with the phone, swap SIM cards and
 someone else is now you.

___

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: memory allocation different in simulator and on the iPhone

2009-07-24 Thread Jesse Armand
Try to use image allocation methods besides imageNamed

Jesse Armand

(http://jessearmand.com)



On Fri, Jul 24, 2009 at 9:07 AM, Dragos Ioneldragosio...@gmail.com wrote:
 Hi,
 I am working on a animal encyclopedia on iPhone. One of the pages displays
 one photo of an animal. When the user swipes the screen the image is
 replaced with another one.

 This works fine and when tested in the simulator with the Instrument for
 Object Allocation, all looks cool.

 When I tested on the real iPhone with Instrument, the memory used increases
 slowly but constantly so that eventually the application dies.

 Here is the method that is doing the image changing (direction means if the
 new image should come from left or from right). The class is a
 UIViewController


 -(void) displayAnimal: (int) animaIndex fromDirection:(int)direction{

  crtIndex = animaIndex;

  NSString* animalName = [[animalList objectAtIndex:animaIndex] objectForKey:
 @name];

 NSString* fileName   = [[animalList objectAtIndex:animaIndex] objectForKey:
 @file];

  self.title = animalName;

  //remove all the subviews

 for (UIView *view in self.view.subviews) {

 [view removeFromSuperview];

 }

  UIView* backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320,
 480)];

 backgroundView.backgroundColor = [UIColor blackColor];

 [self.view addSubview:backgroundView];

 [backgroundView release];

  UIImage* image = [UIImage imageNamed:fileName];

 UIImageView *imageView = [[UIImageView alloc] initWithImage:image];

 [image release];

  CGRect imageFrame = imageView.frame;

 imageFrame.origin = CGPointMake(320*direction,0);

 imageView.frame = imageFrame;

  [self.view addSubview:imageView];


  [UIView beginAnimations: nil context: @identifier];

 [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];

 [UIView setAnimationDuration:0.5];

  imageFrame.origin = CGPointMake(0,0);

 imageView.frame = imageFrame;

  [UIView commitAnimations];

 [imageView release];

 }

 Can you see anything that is not right? Why is the memory allocation showing
 different in simulator and on the iPhone?

 Thanks a lot,
 Dragos
 ___

 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPhone List? - few questions

2009-07-23 Thread Jesse Armand
The sms: URL on the iPhone only supports phone number, unless if
you're willing to go deep into the private API, but you couldn't
distribute your app into the App Store.

My advice is, better to install some kind of sms application or
gateway on your server, so your iPhone app could send the text into
the server, and the server will forward the message through sms.

Jesse Armand

(http://jessearmand.com)



On Thu, Jul 23, 2009 at 2:43 PM, Gustavo
Pizanogustavxcodepic...@gmail.com wrote:
 Nop you didn\'t miss understood the question, I will have a look at the
 docs, because the idea is that once Im in my app, put the first credentials,
 then the server will send me an authorizaiton code, and the idea is to don't
 leave my app to get the data from the sms, but the app fetch the data of the
 incoming sms,  but if you tell me that you think its not possible to get
 more automated than clicking the  arrow in the Iphone sms app to launch
 mine with the data in the url then Im kinda stuck... I will take a look at
 the docs and see what I find out.

 I will let you know if something as you have been thinking about doing the
 same, if find a workaround.

 G.


 On Jul 23, 2009, at 9:27 AM, Roland King wrote:

 If you're trying to use data which has been sms'ed to your user, which is
 something I've thought about doing before, the only way which I thought it
 could be done is to register your own url for the application and then have
 the sms you send include the data in a URL format, eg if your app registered
 URL is foobar you might have foobar://yourdatahere in the SMS. I believe
 that you'll then have the opportunity in the SMS screen to click the 
 arrow at the side of the screen and your app will launch with that URL as
 data and you can process it.

 I don't think you can get any more automated than that. It also relies on
 you sending the data in a compatible format.

 Not totally sure this is related to the UIRequiredDeviceCapabilities
 though, go hunt around the docs for url or 'phone:' and 'text:', I think
 those are a couple of the URLs that apple registers for stuff and the
 documentation is around there.

 If I have misunderstood what you're asking .. sorry

 Gustavo Pizano wrote:

 Aha ok.. thanks.
 I need to develop an iPhone app that fetches sms data form the sender,
  the data are access keys, so I was wondering if tis possible to do  such an
 application.
 I was reading the iPhone App programing Guide, and there is something
  interesting, I can register my app  with some particular keys, in my  case,
 sms into the UIRequiredDeviceCapabilities,  so I can  comunicate with teh
 iPhone app that handles the sms, and fetch the  data... am I correct?
 Thx
 G.
 On Jul 23, 2009, at 9:11 AM, Roland King wrote:

 if your questions are Cocoa, Core Foundation etc related and about
  released software (ie not iPhone OS 3.1), ask away.

 you can try the apple iphone dev forums too if you like (but I dont
  find them anywhere as nearly useful as this list)

 Gustavo Pizano wrote:

 Hello, I wish to know if this list works also for iPhone developer,  I
  hadn't found one related to iPhone except the govIphone, that  its for
  goverment iPhone apps... so.. :S.
 If this is the correct list to write then please let me know so I  can
  ask few questions related.. Im a mac developer but starting to  dev for
  iPhone..
 Thanks
 Gustavo
 ___
 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/rols%40rols.org
 This email sent to r...@rols.org

 ___

 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPhone List? - few questions

2009-07-23 Thread Jesse Armand
I have been there before, for a mobile banking project, and they don't
want to accept my suggestion to process all of the sms processing
(incoming / outgoing) on the server, in order for the iPhone app to
communicate with server only.

That would provide better user experience, because there's no need to
use the carrier-specific features in the iPhone.

You can observe CitiMobile for US, see how do they do it, it's just
like an internet banking, no need for SMS.

In my opinion, iPhone apps shouldn't depend too much on carrier
specific features.

Jesse Armand

(http://jessearmand.com)



On Thu, Jul 23, 2009 at 11:19 PM, Gustavo
Pizanogustavxcodepic...@gmail.com wrote:
 @ Jesse:

 Yes the idea is to distribute the App through the AppStore, so I guess I
 can't go any deeper.

 The idea is that in the server there is gonna be a sms application that will
 send the Authorization code to the registered iPhone that is asking for it,
 then My app should take that access code and connect to the server, its
 kinda a 2 step Login system. So if there is gonna be an inpediment, then the
 sms app in the server will send the sms with the Auth Code, then my iPhone
 will receive the sms, and the sms app of the iPhone will  say Hey you I
 have a new sms, so now that I have the code, I can just copy-paste it in
 the access code of my app and do the second part of the authentication.
 (well that is what its on my mind due that i can't get the data of the
 incoming sms without leaving my iPhone app ).

 I dunno how user friendly is to do such a authentication, as you can see we
 are  working with very critical data that requires a strong authentication
 and data encryption , like a bank sort to speak.


 G.




 On Jul 23, 2009, at 4:42 PM, Roland King wrote:

 Right, but you can register your own url schemes which will launch your
 app and let it handle the data. I've assumed that the SMS displaying
 framework will parse out such URLs, realize they are registered and put the
 correct hotlink into the message to launch your app.


 On Jul 23, 2009, at 9:55 PM, Jesse Armand wrote:

 The sms: URL on the iPhone only supports phone number, unless if
 you're willing to go deep into the private API, but you couldn't
 distribute your app into the App Store.

 My advice is, better to install some kind of sms application or
 gateway on your server, so your iPhone app could send the text into
 the server, and the server will forward the message through sms.

 Jesse Armand
 
 (http://jessearmand.com)



 On Thu, Jul 23, 2009 at 2:43 PM, Gustavo
 Pizanogustavxcodepic...@gmail.com wrote:

 Nop you didn\'t miss understood the question, I will have a look at the
 docs, because the idea is that once Im in my app, put the first
 credentials,
 then the server will send me an authorizaiton code, and the idea is to
 don't
 leave my app to get the data from the sms, but the app fetch the data of
 the
 incoming sms,  but if you tell me that you think its not possible to get
 more automated than clicking the  arrow in the Iphone sms app to
 launch
 mine with the data in the url then Im kinda stuck... I will take a look
 at
 the docs and see what I find out.

 I will let you know if something as you have been thinking about doing
 the
 same, if find a workaround.

 G.


 On Jul 23, 2009, at 9:27 AM, Roland King wrote:

 If you're trying to use data which has been sms'ed to your user, which
 is
 something I've thought about doing before, the only way which I thought
 it
 could be done is to register your own url for the application and then
 have
 the sms you send include the data in a URL format, eg if your app
 registered
 URL is foobar you might have foobar://yourdatahere in the SMS. I
 believe
 that you'll then have the opportunity in the SMS screen to click the
 
 arrow at the side of the screen and your app will launch with that URL
 as
 data and you can process it.

 I don't think you can get any more automated than that. It also relies
 on
 you sending the data in a compatible format.

 Not totally sure this is related to the UIRequiredDeviceCapabilities
 though, go hunt around the docs for url or 'phone:' and 'text:', I
 think
 those are a couple of the URLs that apple registers for stuff and the
 documentation is around there.

 If I have misunderstood what you're asking .. sorry

 Gustavo Pizano wrote:

 Aha ok.. thanks.
 I need to develop an iPhone app that fetches sms data form the sender,
 the data are access keys, so I was wondering if tis possible to do
  such an
 application.
 I was reading the iPhone App programing Guide, and there is something
 interesting, I can register my app  with some particular keys, in my
  case,
 sms into the UIRequiredDeviceCapabilities,  so I can  comunicate
 with teh
 iPhone app that handles the sms, and fetch the  data... am I correct?
 Thx
 G.
 On Jul 23, 2009, at 9:11 AM, Roland King wrote:

 if your questions are Cocoa

Re: Display the elements of array in a tablview ?

2009-07-07 Thread Jesse Armand
I'm not even familiar with Bindings, is it convenient to use ?

I did an intensive development with Cocoa starting with Cocoa Touch,
so I'm used to using the equivalent UITableViewDataSource to populate
table views.

Jesse Armand

(http://jessearmand.com)



On Tue, Jul 7, 2009 at 10:45 PM, I. Savantidiotsavant2...@gmail.com wrote:
 On Jul 7, 2009, at 10:43 AM, Bright wrote:

  There is an array with several elements in my application. And I have
 shown the elements in a tableview
 using binding.
  But now I need to display the elements using code only. Could anyone help
 me? Which method should
 I  use?


  You want to study NSTableDataSource:

 http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Tasks/UsingTableDataSource.html#//apple_ref/doc/uid/2117

  This is how things were done before Bindings. Read thoroughly.

 --
 I.S.



 ___

 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to share Cocoa classes?

2009-07-06 Thread Jesse Armand
Hello Alex,

If you don't want to build a framework, best way to go is building a
static library or else you have to add their sources every time you
want to use it on a new project.

Static library linking with ObjC class, most likely could be done
successfully by only adding -ObjC and -all_load to the Other Linker
Flags in the build configuration.

To be able to use

#import MyDir/MyClass.h,

you need to add a header search path, that refers to that global
directory (or system directory, if you prefer) in your project
settings.

Jesse Armand

(http://jessearmand.com)



On Mon, Jul 6, 2009 at 4:23 PM, Alexander Bokovikovopenwo...@uralweb.ru wrote:
 Hi, All,

 Maybe it's a dummy question, but I can't find a way to share some ObjC
 classes with several XCode projects. I've created a set of Cocoa classes (.h
 and .m files) What I'd like to get is the ability to write something like
 this:

 #import MyDir/MyClass.h

 I don't want to distribute these classes, as a framework, but I would like
 just to link them directly into every executable, which refers them. As I
 heard, a static library, having ObjC classes inside, may cause some problems
 in linking. Therefore I yet didn't try this way.

 My question is: can I copy these shared files (.h + .m) into some system
 directory to make them being visible for any Cocoa project through the
 import directive, like above?

 If no, then what is the correct way to go besides manual inclusion of the
 same files into every XCode project?

 -Thanks.
 ___

 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Subject: Re: How to share Cocoa classes?

2009-07-06 Thread Jesse Armand

 Is this option applicable to library project settings or to a project where
 this library is called from?


Since the linking is done on the project that's including the library,
so this should be done on the project that's using the library.


 Could you please give an example of particular directories, where I could
 put headers as well as the library? All directories at root level are
 write-protected. What is the correct location to put my own libraries?

 Also what particular settings are responsible for headers (and libraries)
 search path?

If you want to put it in /Developer/SDKs/MacOSX10.5.sdk/usr/lib/ you
need to use the user with administrator privileges, just like when you
install the Xcode and its SDK.

If you put it there, the headers should be in
/Developer/SDKs/MacOSX10.5.sdk/usr/include/

But, I usually just put my own projects in my own folders, not system
folder, unless if I want to release that library into the public, as a
part of the Mac OS X SDK, which is unlikely.

When you do the latter, just add a header path corresponding to your
own folder, like:

/Projects/MyLibrary/Headers

Libraries should be added to the project, not searched.
___

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: How to share Cocoa classes?

2009-07-06 Thread Jesse Armand

 Nevertheless, I'd appreciate it highly, if you'll guide me through the XCode
 project settings adjustment, as it sounds foggy for me, how to make static
 library to rebuild itself when main project is built. What particular
 settings should I add to the main project?

Add the target of the project (which will produce the library) to the
project dependencies that's using the static library.


 Also it's not clear, where to put that common header file? What is the
 correct location for that? Am I correct in my understanding, that placing
 this .h file into the right place I'll have the ability to include my
 classes (stored in static library) by single #importmysubdir/myincfile.h ?
 If yes, then it is just, what I'd like to get! The same question is about
 static library itseklf -- where it should be located? Should I create my own
 directory system or is it better to use some standard (system) directories
 for that? If I must use my own directories, then where should I add a path
 to them to avoid the necessarity to add this path to every new XCode project
 manually?


Just create your own directory system, that would be simpler.

To automate the inclusion of that path, you may be able to use Xcode
configuration settings file.
___

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: Send files from iphone

2009-07-04 Thread Jesse Armand
I'm not quite sure about whether Available in Mac OS X version 10.1
and later means that it's not available in iPhone OS.

But, I assume everything that exists on iPhone OS reference library,
exists on iPhone OS, because that's also the case with
NSURLConnection, which obviously exists on iPhone OS.

Jesse Armand

(http://jessearmand.com)



On Sat, Jul 4, 2009 at 6:58 PM, Peter
Mulhollanddarkmat...@blueyonder.co.uk wrote:
 Hello Development,

 Saturday, July 4, 2009, 3:20:45 AM, you wrote:

 I need to be able to upload the data from a UIImage to a server via
 http POST however I simply cannot find a good example of how to
 arrange the headers or how to make this post.
 The only data I need to send to the server is the file's name, the
 user's name and the data itself and I simply cannot seem to get it to
 work. Can any of you offer a helping hand?


 I don't know if CoreFoundation stuff is available on iPhone but if it is, 
 CFHTTPMessage is an excellent way to do HTTP POST.

 Best regards,
  Peter                            mailto:darkmat...@blueyonder.co.uk

 ___

 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPhone UIWebView height?

2009-03-14 Thread Jesse Armand
This is also what I'm looking for.

I want to create a UIWebView with a frame size that will adjust itself
according to the contents of the HTML string, or even more simpler an
image.

Anybody have any experiences with this ?

Jesse Armand

(http://jessearm.blogspot.com)



On Sun, Mar 15, 2009 at 8:12 AM, William Jon Shipley
w...@delicious-monster.com wrote:
 Is it possible to set an HTML string on a UIWebView and have it resize
 automatically to the right height, but NOT take up the entire screen?

 I sure can't figure it out. I feel like the iPhone really HATES rich text.

 Here's what I've tried so far. Most of these are Hail Mary attempts, which
 I didn't expect to work:

        UIWebView *synopsisWebView = [[UIWebView alloc]
 initWithFrame:(CGRect){CGPointZero, {CGRectGetWidth(self.scrollView.frame),
 30.0}}];
        synopsisWebView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
 // unrelated?
        synopsisWebView.scalesPageToFit = YES; // just shrinks text
        [synopsisWebView loadHTMLString:synopsisHTMLString baseURL:nil];
        [self.scrollView addSubview:synopsisWebView];
        [synopsisWebView layoutIfNeeded]; // no visible effect
        [synopsisWebView release];
        NSLog(@synopsisWebView frame %@,
 NSStringFromCGRect(synopsisWebView.frame)); // still 30 high!


 -W
 ___

 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/mnemonic.fx%40gmail.com

 This email sent to mnemonic...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: AudioQueueServices Tutorial?

2008-09-17 Thread Jesse Armand
Well that's the issue most people is having, especially on iPhone SDK.

But I think for Mac Desktop, the Apple docs is sufficient.

Jesse Armand

(http://jessearm.blogspot.com)



On Wed, Sep 17, 2008 at 3:22 PM, Muhammad Ishaq [EMAIL PROTECTED] wrote:
 Hi Everyone,

  I was just curious if there's a step by step AudioQueueServices
 Tutorial somewhere, I have gone through Apple's documentation but it is
 making my head spin (I am new to Mac Development)

 --
 MI
 ___

 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/mnemonic.fx%40gmail.com

 This email sent to [EMAIL PROTECTED]

___

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]


NSInvalidArgumentException', reason: '*** -[NSCFArray insertObject:atIndex:]: attempt to insert nil

2008-07-06 Thread Jesse Armand
Hello fellow developers,

Is there any of you can give me an idea on the cause of this uncaught exception:

'NSInvalidArgumentException', reason: '*** -[NSCFArray
insertObject:atIndex:]: attempt to insert nil'

I can't seem to find where I should look to trace for this problem,
even though I thought this could be happening because I'd done
something wrong related to CFRunLoop.

I have searched everywhere for this, but none of it points me to guide
on how to trace the errors related to this message.

-- 
Jesse Armand

barablu (http://www.barablu.com)
iPhone Developer
(http://jessearm.blogspot.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: adding a delegate to a class

2008-06-10 Thread Jesse Armand
Hello Angelo,

I think this code might help you:

@protocol BackgroundObjDelegate NSObject
@optional

- (void)showText:(NSString*)text;

@end

@interface BackgroundObj : NSObject
{
   idBackgroundObjDelegate _delegate;
}

@property(assign) idBackgroundObjDelegate delegate

- (void) sayHi;

@end

@implementation BackgroundObj

@synthesize delegate=_delegate;

- (void) sayHi
{
   if ([_delegate respondsToSelector:@selector(showText:)])
   [_delegate showText:@Hi];
}

@end

Then, you could implement your delegate class, for example:

@interface ForegroundObj : NSObject BackgroundObjDelegate
{
 // Insert your instance variables
}

- (void)showText:(NSString*)text;

@end

@implementation ForegroundObj

- (id)init
{
if (![super init])
 return nil;

BackgroundObj *obj = [[BackgroundObj alloc] init];
obj.delegate = self;// set the background object delegate

return self;
}

- (void)showText:(NSString*)text
{
// Insert your code
}

@end

If you have any questions, just ask, and please read Apple Docs, since
it's already quite complete in explaining these.

Regards,

Jesse
-
barablu (www.barablu.com), iPhone developer (http://jessearm.blogspot.com)

2008/6/10 Angelo Chen [EMAIL PROTECTED]:
 Hi,

 I have a code like this:

 @interface BackgroundObj : NSObject
 {
Controller *mc;
 }

 - (void) sayHi;


 @implementation BackgroundObj

 - (void) sayHi
 {
[mc showText:@Hi];
 }
 @end

 As you can see, the code is hard coded to use class Controller, can not be 
 used with any other object, I'd like to add a delegate which will have a 
 showText method, sayHi method will just call the delegate instead of hard 
 coded Controller, any idea how to add delegates to this object? or, any 
 tutorials for this? Thanks,

 Angelo




  Yahoo! Mail具備一流的網上安全保護功能,請前往 http://hk.antispam.yahoo.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:
 http://lists.apple.com/mailman/options/cocoa-dev/mnemonic.fx%40gmail.com

 This email sent to [EMAIL PROTECTED]

___

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]