rubymotion-community / sugarcube

Some sugar for your cocoa. RubyMotion helpers.
Other
422 stars 66 forks source link

UIAlertView syntax issues #9

Closed ParkinT closed 12 years ago

ParkinT commented 12 years ago

I am trying to use (and understand) the new Alert you just added to SugarCube. First, I get serious complaints about the syntax copied and pasted from the README. The same with the example code in the head of uialertview.rb

So, in troubleshooting this, I reduced it all to

 UIAlert.alert("TITLE")

And that results in this very strange error message

Objective-C stub for message initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:' type@@:@@@@@' not precompiled. Make sure you properly link with the framework or library that defines this message.

I am able to call

 popup = UIAlertView.alloc.init
 popup.setTitle("TITLE")
 popup.addButtonWithTitle("BUTTON")
 popup.show

with success.

I am stumped.

SDK 5.1 BTW

colinta commented 12 years ago

Interesting... I use that thing pretty often, I must have the documentation messed up. Thanks for the heads up! Easily fixed I'm sure. I should have time in the morning to play with it.

On Aug 30, 2012, at 10:37 PM, Thom Parkin notifications@github.com wrote:

I am trying to use (and understand) the new Alert you just added to SugarCube. First, I get serious complaints about the syntax copied and pasted from the README. The same with the example code in the head of uialertview.rb

So, in troubleshooting this, I reduced it all to

UIAlert.alert("TITLE") And that results in this very strange error message

Objective-C stub for message initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:' type@@:@@@@@' not precompiled. Make sure you properly link with the framework or library that defines this message.

I am able to call

popup = UIAlertView.alloc.init popup.setTitle("TITLE") popup.show with success.

I am stumped.

SDK 5.1 BTW

\ Reply to this email directly or view it on GitHub.

colinta commented 12 years ago

I have not been able to reproduce your errors. Both from the REPL and in code, all the examples work, and UIAlertView.alert('TITLE') is fine as well.

ParkinT commented 12 years ago

Well. I guess there is a problem with my app! "But my code is always right!!" LOL

I will start with a new, fresh RM application. I have decided to build an app called "Pyramid" in honor of the [quite popular] idea of constructing elaborate models out of sugarcubes.

If I throw together a skeleton of something on Github and provide you commit permissions will you apply some of your expertise? It sure would be fun to build this together. I am a trainer of Software Developers (worldwide) by day - working on a US Air Force contract - and I know how valuable a working example project can be for learning and understanding a software framework/library/utility/etc.

You have done a tremendous job with SugarCube (I humbly hope I can commit some useful additions to the entire collection). I am probably your biggest fan.

Thom Parkin Lady Lake, Florida

On Sep 5, 2012, at 10:37 AM, Colin Thomas-Arnold wrote:

I have not been able to reproduce your errors. Both from the REPL and in code, all the examples work, and UIAlertView.alert('TITLE') is fine as well.

— Reply to this email directly or view it on GitHub.

colinta commented 12 years ago

Of course! I'm a firm believer in the idea that helping and teaching are the fastest ways to understanding. Count me in!

On Sep 6, 2012, at 8:03 PM, Thom Parkin notifications@github.com wrote:

Well. I guess there is a problem with my app! "But my code is always right!!" LOL

I will start with a new, fresh RM application. I have decided to build an app called "Pyramid" in honor of the [quite popular] idea of constructing elaborate models out of sugarcubes.

If I throw together a skeleton of something on Github and provide you commit permissions will you apply some of your expertise? It sure would be fun to build this together. I am a trainer of Software Developers (worldwide) by day - working on a US Air Force contract - and I know how valuable a working example project can be for learning and understanding a software framework/library/utility/etc.

You have done a tremendous job with SugarCube (I humbly hope I can commit some useful additions to the entire collection). I am probably your biggest fan.

Thom Parkin Lady Lake, Florida

On Sep 5, 2012, at 10:37 AM, Colin Thomas-Arnold wrote:

I have not been able to reproduce your errors. Both from the REPL and in code, all the examples work, and UIAlertView.alert('TITLE') is fine as well.

\ Reply to this email directly or view it on GitHub.

\ Reply to this email directly or view it on GitHub.

ParkinT commented 12 years ago

Awesome. I will be on business travel over the next week and, likely, will not have as much free time. But, if you can be patient for about a week I promise to have something started. Your support (and participation) will be key in the success of such a project. Thanks, Colin.

ParkinT commented 12 years ago

Alright. This is truly weird. I created a new RubyMotion app motion create pyramid And added the "include" in the Rakefile for Sugarcube. Then I only added this in the app_delegate.rb

UIAlertView.alert "This is happening, OK?" { self.happened! }

This is the error I get AFTER it compiles and [attempts to] run

(main)> {}
#
Objective-C stub for message `initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:' type `@@:@@@@@' not precompiled. Make sure you properly link with the framework or library that defines this message.
colinta commented 12 years ago

This has finally been fixed! Thanks for the clue, sorry it took so long for me to get to it.