New and stuck

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

New and stuck

Ken Lavigne
Hi, I am just evaluating MonoTouch and like it. However I am apparently doing something very wrong and can't figure it out. I have a UITabbarController app with 2 views. I use 2 xib files. On both tabs I load a standard UIViewController. Just as a test, I have 1 label and 1 button on the 1st controllers view. If I don't connect any outlets or actions, the app will load in the simulator and I can switch views just fine with the tabs. But as soon as I connect the label to an outlet, or the button to an action (it's touch up inside) I get the following error


Unhandled Exception: MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSUnknownKeyException Reason: [<UIViewController 0x717e470> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key myLabel.
  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:26
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args) [0x00000] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:31
  at ANewTest.Application.Main (System.String[] args) [0x00000] in /Users/KLavigne/Mono/Projects/ANewTest/ANewTest/Main.cs:14


I get this on any project I try to connect to. I have even downloaded an example solution and get the same behavior. I have reinstalled mono, monotouch and monodeveloper with the same results. I really want to be able to use this as i'm not very fond of Objective-C comming from the Windows world!

Thanks for your help.
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Nic Wise
Hi Ken

Can you post some code (using pastebin.com or monobin.com)? Esp your
UIApplicationDelegate.

Cheers

N

On Fri, Apr 22, 2011 at 22:03, kenlavigne <[hidden email]> wrote:

> Hi, I am just evaluating MonoTouch and like it. However I am apparently doing
> something very wrong and can't figure it out. I have a UITabbarController
> app with 2 views. I use 2 xib files. On both tabs I load a standard
> UIViewController. Just as a test, I have 1 label and 1 button on the 1st
> controllers view. If I don't connect any outlets or actions, the app will
> load in the simulator and I can switch views just fine with the tabs. But as
> soon as I connect the label to an outlet, or the button to an action (it's
> touch up inside) I get the following error
>
>
> Unhandled Exception: MonoTouch.Foundation.MonoTouchException: Objective-C
> exception thrown.  Name: NSUnknownKeyException Reason: [<UIViewController
> 0x717e470> setValue:forUndefinedKey:]: this class is not key value
> coding-compliant for the key myLabel.
>  at (wrapper managed-to-native)
> MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
>  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String
> principalClassName, System.String delegateClassName) [0x00038] in
> /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:26
>  at MonoTouch.UIKit.UIApplication.Main (System.String[] args) [0x00000] in
> /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:31
>  at ANewTest.Application.Main (System.String[] args) [0x00000] in
> /Users/KLavigne/Mono/Projects/ANewTest/ANewTest/Main.cs:14
>
>
> I get this on any project I try to connect to. I have even downloaded an
> example solution and get the same behavior. I have reinstalled mono,
> monotouch and monodeveloper with the same results. I really want to be able
> to use this as i'm not very fond of Objective-C comming from the Windows
> world!
>
> Thanks for your help.
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3468881.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/ | http://www.flickr.com/photos/nicwise

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Ken Lavigne
Hi Nic,
Thanks for getting back to me. I have all my source here. It is a new plain project. I haven't added any code except what got added after creating a reference outlet to the Section1Controller class. I don't even get the error by just having the outlet declared. It only fails when I connect the label to the outlet in IB. I don't know what else to do. Thanks for looking at it. Here's my code.



/***************************************************************
 * This is the main.cs file
 * **********************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace ANewTest
{
        public class Application
        {
                static void Main (string[] args)
                {
                        UIApplication.Main (args);
                }
        }

        // The name AppDelegate is referenced in the MainWindow.xib file.
        public partial class AppDelegate : UIApplicationDelegate
        {
                // This method is invoked when the application has loaded its UI and its ready to run
                public override bool FinishedLaunching (UIApplication app, NSDictionary options)
                {
                        // If you have defined a view, add it here:
                        // window.AddSubview (navigationController.View);
                        window.AddSubview (tabBarController.View);
                        window.MakeKeyAndVisible ();
                       
                        return true;
                }

                // This method is required in iPhoneOS 3.0
                public override void OnActivated (UIApplication application)
                {
                }
        }
}

/****************************************************************
 * My MainWindow.xib.desiner.cs
 * ***********************************************************/

        // ------------------------------------------------------------------------------
//  <autogenerated>
//      This code was generated by a tool.
//      Mono Runtime Version: 2.0.50727.1433
//
//      Changes to this file may cause incorrect behavior and will be lost if
//      the code is regenerated.
//  </autogenerated>
// ------------------------------------------------------------------------------

namespace ANewTest {
       
       
        // Base type probably should be MonoTouch.Foundation.NSObject or subclass
        [MonoTouch.Foundation.Register("AppDelegate")]
        public partial class AppDelegate {
               
                private MonoTouch.UIKit.UIWindow __mt_window;
               
                private MonoTouch.UIKit.UITabBarController __mt_tabBarController;
               
                #pragma warning disable 0169
                [MonoTouch.Foundation.Connect("window")]
                private MonoTouch.UIKit.UIWindow window {
                        get {
                                this.__mt_window = ((MonoTouch.UIKit.UIWindow)(this.GetNativeField("window")));
                                return this.__mt_window;
                        }
                        set {
                                this.__mt_window = value;
                                this.SetNativeField("window", value);
                        }
                }
               
                [MonoTouch.Foundation.Connect("tabBarController")]
                private MonoTouch.UIKit.UITabBarController tabBarController {
                        get {
                                this.__mt_tabBarController = ((MonoTouch.UIKit.UITabBarController)(this.GetNativeField("tabBarController")));
                                return this.__mt_tabBarController;
                        }
                        set {
                                this.__mt_tabBarController = value;
                                this.SetNativeField("tabBarController", value);
                        }
                }
        }
}


/*************************************************
This is the controller that is giving me the error
***************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace ANewTest
{
        public partial class Section1Controller : UIViewController
        {
                #region Constructors

                // The IntPtr and initWithCoder constructors are required for items that need
                // to be able to be created from a xib rather than from managed code

                public Section1Controller (IntPtr handle) : base(handle)
                {
                        Initialize ();
                }

                [Export("initWithCoder:")]
                public Section1Controller (NSCoder coder) : base(coder)
                {
                        Initialize ();
                }

                public Section1Controller () : base("Section1Controller", null)
                {
                        Initialize ();
                }

                void Initialize ()
                {
                }
               
                #endregion
        }
}

/****************************************************************************
 * This is the Section1.designer.cs file
 * ************************************************************************/


// ------------------------------------------------------------------------------
//  <autogenerated>
//      This code was generated by a tool.
//      Mono Runtime Version: 2.0.50727.1433
//
//      Changes to this file may cause incorrect behavior and will be lost if
//      the code is regenerated.
//  </autogenerated>
// ------------------------------------------------------------------------------

namespace ANewTest {
       
       
        // Base type probably should be MonoTouch.UIKit.UIViewController or subclass
        [MonoTouch.Foundation.Register("Section1Controller")]
        public partial class Section1Controller {
               
                private MonoTouch.UIKit.UIView __mt_view;
               
                private MonoTouch.UIKit.UILabel __mt_myLabel;
               
                #pragma warning disable 0169
                [MonoTouch.Foundation.Connect("view")]
                private MonoTouch.UIKit.UIView view {
                        get {
                                this.__mt_view = ((MonoTouch.UIKit.UIView)(this.GetNativeField("view")));
                                return this.__mt_view;
                        }
                        set {
                                this.__mt_view = value;
                                this.SetNativeField("view", value);
                        }
                }
               
                [MonoTouch.Foundation.Connect("myLabel")]
                private MonoTouch.UIKit.UILabel myLabel {
                        get {
                                this.__mt_myLabel = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("myLabel")));
                                return this.__mt_myLabel;
                        }
                        set {
                                this.__mt_myLabel = value;
                                this.SetNativeField("myLabel", value);
                        }
                }
        }
}

Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Nic Wise
I think this is why I only ever use TabControllers via code, not IB
(actually, I tend to avoid IB)

http://www.iphonedevsdk.com/forum/iphone-sdk-development/3439-class-not-key-value-coding-compliant.html

http://www.iphonedevsdk.com/forum/iphone-sdk-development/3162-problem-creating-tableview-tabbar-app.html

https://discussions.apple.com/thread/1598422?threadID=1598422

"In short:
Beside naming/locate the nib file, you must also set the class in the
view inside the tab bar."

Looks like it's not MT-specific problem :)




On Wed, Apr 27, 2011 at 01:49, kenlavigne <[hidden email]> wrote:

> Hi Nic,
> Thanks for getting back to me. I have all my source here. It is a new plain
> project. I haven't added any code except what got added after creating a
> reference outlet to the Section1Controller class. I don't even get the error
> by just having the outlet declared. It only fails when I connect the label
> to the outlet in IB. I don't know what else to do. Thanks for looking at it.
> Here's my code.
>
>
>
> /***************************************************************
>  * This is the main.cs file
>  * **********************************************************/
>
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using MonoTouch.Foundation;
> using MonoTouch.UIKit;
>
> namespace ANewTest
> {
>        public class Application
>        {
>                static void Main (string[] args)
>                {
>                        UIApplication.Main (args);
>                }
>        }
>
>        // The name AppDelegate is referenced in the MainWindow.xib file.
>        public partial class AppDelegate : UIApplicationDelegate
>        {
>                // This method is invoked when the application has loaded its UI and its
> ready to run
>                public override bool FinishedLaunching (UIApplication app, NSDictionary
> options)
>                {
>                        // If you have defined a view, add it here:
>                        // window.AddSubview (navigationController.View);
>                        window.AddSubview (tabBarController.View);
>                        window.MakeKeyAndVisible ();
>
>                        return true;
>                }
>
>                // This method is required in iPhoneOS 3.0
>                public override void OnActivated (UIApplication application)
>                {
>                }
>        }
> }
>
> /****************************************************************
>  * My MainWindow.xib.desiner.cs
>  * ***********************************************************/
>
>        //
> ------------------------------------------------------------------------------
> //  <autogenerated>
> //      This code was generated by a tool.
> //      Mono Runtime Version: 2.0.50727.1433
> //
> //      Changes to this file may cause incorrect behavior and will be lost
> if
> //      the code is regenerated.
> //  </autogenerated>
> //
> ------------------------------------------------------------------------------
>
> namespace ANewTest {
>
>
>        // Base type probably should be MonoTouch.Foundation.NSObject or subclass
>        [MonoTouch.Foundation.Register("AppDelegate")]
>        public partial class AppDelegate {
>
>                private MonoTouch.UIKit.UIWindow __mt_window;
>
>                private MonoTouch.UIKit.UITabBarController __mt_tabBarController;
>
>                #pragma warning disable 0169
>                [MonoTouch.Foundation.Connect("window")]
>                private MonoTouch.UIKit.UIWindow window {
>                        get {
>                                this.__mt_window =
> ((MonoTouch.UIKit.UIWindow)(this.GetNativeField("window")));
>                                return this.__mt_window;
>                        }
>                        set {
>                                this.__mt_window = value;
>                                this.SetNativeField("window", value);
>                        }
>                }
>
>                [MonoTouch.Foundation.Connect("tabBarController")]
>                private MonoTouch.UIKit.UITabBarController tabBarController {
>                        get {
>                                this.__mt_tabBarController =
> ((MonoTouch.UIKit.UITabBarController)(this.GetNativeField("tabBarController")));
>                                return this.__mt_tabBarController;
>                        }
>                        set {
>                                this.__mt_tabBarController = value;
>                                this.SetNativeField("tabBarController", value);
>                        }
>                }
>        }
> }
>
>
> /*************************************************
> This is the controller that is giving me the error
> ***************************************************/
>
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using MonoTouch.Foundation;
> using MonoTouch.UIKit;
>
> namespace ANewTest
> {
>        public partial class Section1Controller : UIViewController
>        {
>                #region Constructors
>
>                // The IntPtr and initWithCoder constructors are required for items that
> need
>                // to be able to be created from a xib rather than from managed code
>
>                public Section1Controller (IntPtr handle) : base(handle)
>                {
>                        Initialize ();
>                }
>
>                [Export("initWithCoder:")]
>                public Section1Controller (NSCoder coder) : base(coder)
>                {
>                        Initialize ();
>                }
>
>                public Section1Controller () : base("Section1Controller", null)
>                {
>                        Initialize ();
>                }
>
>                void Initialize ()
>                {
>                }
>
>                #endregion
>        }
> }
>
> /****************************************************************************
>  * This is the Section1.designer.cs file
>  * ************************************************************************/
>
>
> //
> ------------------------------------------------------------------------------
> //  <autogenerated>
> //      This code was generated by a tool.
> //      Mono Runtime Version: 2.0.50727.1433
> //
> //      Changes to this file may cause incorrect behavior and will be lost
> if
> //      the code is regenerated.
> //  </autogenerated>
> //
> ------------------------------------------------------------------------------
>
> namespace ANewTest {
>
>
>        // Base type probably should be MonoTouch.UIKit.UIViewController or
> subclass
>        [MonoTouch.Foundation.Register("Section1Controller")]
>        public partial class Section1Controller {
>
>                private MonoTouch.UIKit.UIView __mt_view;
>
>                private MonoTouch.UIKit.UILabel __mt_myLabel;
>
>                #pragma warning disable 0169
>                [MonoTouch.Foundation.Connect("view")]
>                private MonoTouch.UIKit.UIView view {
>                        get {
>                                this.__mt_view =
> ((MonoTouch.UIKit.UIView)(this.GetNativeField("view")));
>                                return this.__mt_view;
>                        }
>                        set {
>                                this.__mt_view = value;
>                                this.SetNativeField("view", value);
>                        }
>                }
>
>                [MonoTouch.Foundation.Connect("myLabel")]
>                private MonoTouch.UIKit.UILabel myLabel {
>                        get {
>                                this.__mt_myLabel =
> ((MonoTouch.UIKit.UILabel)(this.GetNativeField("myLabel")));
>                                return this.__mt_myLabel;
>                        }
>                        set {
>                                this.__mt_myLabel = value;
>                                this.SetNativeField("myLabel", value);
>                        }
>                }
>        }
> }
>
>
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3477021.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/ | http://www.flickr.com/photos/nicwise

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Ken Lavigne
Nic Than you sooo much. I have been stuck on this for over a week. I had even carefully recreated the exact steps in XCode to see if maybe I forgot something. The XCode version had worked for me. I guess after a while you can't see your own mistakes. I don't know if I would have figured this one out on my own. I did go ahead and purchase the package, so I am now an official licensed user. Got MonoDroid at half price too. Again, Thanks for everything. You were a life savor!!
Reply | Threaded
Open this post in threaded view
|

Creating a custom animatable property

Mark Smith
In reply to this post by Nic Wise
Hi,

I'm trying to create a custom property on a CALayer-derived class which I then want to animate via CABasicAnimation.  As I understand it, I need to export the property to make it visible to KVC, so I did this:

[Export("swoopColor")]
public UIColor SwoopColor
{
[Export("swoopColor")]
get { return _startColor; }
[Export("setSwoopColor")]
set { _startColor = value; SetNeedsDisplay(); }
}

I am then trying to animate it:

CABasicAnimation colorChange = CABasicAnimation.FromKeyPath("swoopColor");
colorChange.From = NSValue.ValueFromPointer(startColor.CGColor.Handle);
colorChange.To = NSValue.ValueFromPointer(endColor.CGColor.Handle);
colorChange.Duration = 2;
colorChange.AutoReverses = true;
colorChange.RepeatCount = float.PositiveInfinity;
AddAnimation(slideSwoop, "animateColor");

I saw on SO that someone else had a similar issue, but there was no resolution.  I'm sure I'm doing something silly, but I can't seem to figure out exactly what it is.. It doesn't even appear to be queried in my needsDisplayForKey: method implementation.

Any help would be much appreciated!

Thanks,

Mark Smith



_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Nic Wise
In reply to this post by Ken Lavigne
No problem - glad to help!

I can recommend atleast trying to build your UI once or write in code
- you get a good idea of how everything hangs together. I prefer it
over IB, but each to their own :)

Speaking of which, I need to get MD....

On Wed, Apr 27, 2011 at 23:47, kenlavigne <[hidden email]> wrote:

> Nic Than you sooo much. I have been stuck on this for over a week. I had even
> carefully recreated the exact steps in XCode to see if maybe I forgot
> something. The XCode version had worked for me. I guess after a while you
> can't see your own mistakes. I don't know if I would have figured this one
> out on my own. I did go ahead and purchase the package, so I am now an
> official licensed user. Got MonoDroid at half price too. Again, Thanks for
> everything. You were a life savor!!
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3479658.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/ | http://www.flickr.com/photos/nicwise

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: Creating a custom animatable property

Mark Smith
In reply to this post by Nic Wise

Hi all,

I've narrowed down my problem to expressing a CGColor as an NSObject.  Here's a working native sample which will animate a fillColor property of a CAShapeLayer from red to blue.


colorAnimation.fromValue = (id) [UIColor redColor].CGColor;
colorAnimation.toValue = (id) [UIColor blueColor].CGColor;

Here's my attempt to translate it to MonoTouch:


colorAnimation.fromValue = NSObject.FromObject(UIColor.Red.CGColor);
colorAnimation.toValue = NSObject.FromObject(UIColor.Blue.CGColor);

I've also tried NSValue.FromObject and NSValue.ValueFromPointer passing in the Handle from the CGColor with no success.  Is there a way to box the CGColor value?

Thanks for any help!

Mark Smith

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Ken Lavigne
In reply to this post by Nic Wise
ok, I think I'm ready to give up on IB. Is there somewhere on the web I haven't found where I can get a good example of creating interfaces with mt in code? I find some example doing it in xcode, but I'm new to this whole new apple world (down to the frustrating keyboard behaviour :( ). I just don't know enough about xcode or mt to look at an xcode example and convert it to mt. I was doing fine till I wanted to have a 3 tab controller, where tab 1 has a nav controller, tab 2 has a table view controller, and tab 3 has another nav controller. I had the 1st 2 working fine. But as soon as I added the nav controller to the 3rd tab, it died. If i left it a UIViewController, it was ok. I then tried a new test project and got the same results. I was extremely careful to make sure I created the 3rd tabe exactly like the 1st. My root views were created identically. But as soon as I touch the 3rd tab, it dies with unrecognized selector sent to 0xetc. I would think that IB could handle this easily, but maybe I'm naive, or i'm just plain dumb.

Thanks for your help.
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

jawbrey
I feel your pain.  I've done all of my UI in code.  95% of my UI is tableviews, so I'm not sure there is any advantage to using IB.

On Wed, May 4, 2011 at 7:57 PM, kenlavigne <[hidden email]> wrote:
ok, I think I'm ready to give up on IB. Is there somewhere on the web I
haven't found where I can get a good example of creating interfaces with mt
in code? I find some example doing it in xcode, but I'm new to this whole
new apple world (down to the frustrating keyboard behaviour :( ). I just
don't know enough about xcode or mt to look at an xcode example and convert
it to mt. I was doing fine till I wanted to have a 3 tab controller, where
tab 1 has a nav controller, tab 2 has a table view controller, and tab 3 has
another nav controller. I had the 1st 2 working fine. But as soon as I added
the nav controller to the 3rd tab, it died. If i left it a UIViewController,
it was ok. I then tried a new test project and got the same results. I was
extremely careful to make sure I created the 3rd tabe exactly like the 1st.
My root views were created identically. But as soon as I touch the 3rd tab,
it dies with unrecognized selector sent to 0xetc. I would think that IB
could handle this easily, but maybe I'm naive, or i'm just plain dumb.

Thanks for your help.

--
View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3497225.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch


_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Fencer04
I like to set up my initial views in IB and then programatically create the smaller more custom views. I think it saves me time on the easier views.

Justin Hansen

On May 4, 2011, at 9:02 PM, Jason Awbrey <[hidden email]> wrote:

I feel your pain.  I've done all of my UI in code.  95% of my UI is tableviews, so I'm not sure there is any advantage to using IB.

On Wed, May 4, 2011 at 7:57 PM, kenlavigne <[hidden email]> wrote:
ok, I think I'm ready to give up on IB. Is there somewhere on the web I
haven't found where I can get a good example of creating interfaces with mt
in code? I find some example doing it in xcode, but I'm new to this whole
new apple world (down to the frustrating keyboard behaviour :( ). I just
don't know enough about xcode or mt to look at an xcode example and convert
it to mt. I was doing fine till I wanted to have a 3 tab controller, where
tab 1 has a nav controller, tab 2 has a table view controller, and tab 3 has
another nav controller. I had the 1st 2 working fine. But as soon as I added
the nav controller to the 3rd tab, it died. If i left it a UIViewController,
it was ok. I then tried a new test project and got the same results. I was
extremely careful to make sure I created the 3rd tabe exactly like the 1st.
My root views were created identically. But as soon as I touch the 3rd tab,
it dies with unrecognized selector sent to 0xetc. I would think that IB
could handle this easily, but maybe I'm naive, or i'm just plain dumb.

Thanks for your help.

--
View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3497225.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Yawar Khan
I know it is been hard to work with mono because on native exceptions it wasn't able to pin point the exact issue. I advice you to have some grip over xcode and objective-c. You may be moving one navigational controller into another one (on selecting third tab).

Yawar Khan

On Thu, May 5, 2011 at 7:07 AM, Justin Hansen <[hidden email]> wrote:
I like to set up my initial views in IB and then programatically create the smaller more custom views. I think it saves me time on the easier views.

Justin Hansen

On May 4, 2011, at 9:02 PM, Jason Awbrey <[hidden email]> wrote:

I feel your pain.  I've done all of my UI in code.  95% of my UI is tableviews, so I'm not sure there is any advantage to using IB.

On Wed, May 4, 2011 at 7:57 PM, kenlavigne <[hidden email][hidden email]> wrote:
ok, I think I'm ready to give up on IB. Is there somewhere on the web I
haven't found where I can get a good example of creating interfaces with mt
in code? I find some example doing it in xcode, but I'm new to this whole
new apple world (down to the frustrating keyboard behaviour :( ). I just
don't know enough about xcode or mt to look at an xcode example and convert
it to mt. I was doing fine till I wanted to have a 3 tab controller, where
tab 1 has a nav controller, tab 2 has a table view controller, and tab 3 has
another nav controller. I had the 1st 2 working fine. But as soon as I added
the nav controller to the 3rd tab, it died. If i left it a UIViewController,
it was ok. I then tried a new test project and got the same results. I was
extremely careful to make sure I created the 3rd tabe exactly like the 1st.
My root views were created identically. But as soon as I touch the 3rd tab,
it dies with unrecognized selector sent to 0xetc. I would think that IB
could handle this easily, but maybe I'm naive, or i'm just plain dumb.

Thanks for your help.

--
View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3497225.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[hidden email][hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch



_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

eternalbard
Well I didn't make yet a complex ui with tab inside tab, but until now I just use the IB, trying to follow the visual studio point of view as I'm porting windows mobile to iOS. Except for a generic ComboBox and the "engine" for a picture viewer (that main static views is inside IB too).

But I don't know the level of ui complexity I will get in future with IB.

Karl

From: Yawar Khan <[hidden email]>
Date: Thu, 5 May 2011 10:15:02 +0500
To: Justin Hansen <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Subject: Re: [MonoTouch] New and stuck

I know it is been hard to work with mono because on native exceptions it wasn't able to pin point the exact issue. I advice you to have some grip over xcode and objective-c. You may be moving one navigational controller into another one (on selecting third tab).

Yawar Khan

On Thu, May 5, 2011 at 7:07 AM, Justin Hansen <[hidden email]> wrote:
I like to set up my initial views in IB and then programatically create the smaller more custom views. I think it saves me time on the easier views.

Justin Hansen

On May 4, 2011, at 9:02 PM, Jason Awbrey <[hidden email]> wrote:

I feel your pain.  I've done all of my UI in code.  95% of my UI is tableviews, so I'm not sure there is any advantage to using IB.

On Wed, May 4, 2011 at 7:57 PM, kenlavigne <[hidden email][hidden email]> wrote:
ok, I think I'm ready to give up on IB. Is there somewhere on the web I
haven't found where I can get a good example of creating interfaces with mt
in code? I find some example doing it in xcode, but I'm new to this whole
new apple world (down to the frustrating keyboard behaviour :( ). I just
don't know enough about xcode or mt to look at an xcode example and convert
it to mt. I was doing fine till I wanted to have a 3 tab controller, where
tab 1 has a nav controller, tab 2 has a table view controller, and tab 3 has
another nav controller. I had the 1st 2 working fine. But as soon as I added
the nav controller to the 3rd tab, it died. If i left it a UIViewController,
it was ok. I then tried a new test project and got the same results. I was
extremely careful to make sure I created the 3rd tabe exactly like the 1st.
My root views were created identically. But as soon as I touch the 3rd tab,
it dies with unrecognized selector sent to 0xetc. I would think that IB
could handle this easily, but maybe I'm naive, or i'm just plain dumb.

Thanks for your help.

--
View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3497225.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[hidden email][hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch


_______________________________________________ MonoTouch mailing list [hidden email] http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Nic Wise
I can post some sample code if you like, which I use to build my
interface for mobileAgent. It's not going to compile (it's just a
snippit), but it should give you some idea....



On Thu, May 5, 2011 at 15:34, Karl Heinz Brehme Arredondo
<[hidden email]> wrote:

> Well I didn't make yet a complex ui with tab inside tab, but until now I
> just use the IB, trying to follow the visual studio point of view as I'm
> porting windows mobile to iOS. Except for a generic ComboBox and the
> "engine" for a picture viewer (that main static views is inside IB too).
> But I don't know the level of ui complexity I will get in future with IB.
> Karl
> From: Yawar Khan <[hidden email]>
> Date: Thu, 5 May 2011 10:15:02 +0500
> To: Justin Hansen <[hidden email]>
> Cc: "[hidden email]" <[hidden email]>
> Subject: Re: [MonoTouch] New and stuck
>
> I know it is been hard to work with mono because on native exceptions it
> wasn't able to pin point the exact issue. I advice you to have some grip
> over xcode and objective-c. You may be moving one navigational controller
> into another one (on selecting third tab).
> Yawar Khan
>
> On Thu, May 5, 2011 at 7:07 AM, Justin Hansen <[hidden email]> wrote:
>>
>> I like to set up my initial views in IB and then programatically create
>> the smaller more custom views. I think it saves me time on the easier views.
>>
>> Justin Hansen
>> On May 4, 2011, at 9:02 PM, Jason Awbrey <[hidden email]> wrote:
>>
>> I feel your pain.  I've done all of my UI in code.  95% of my UI is
>> tableviews, so I'm not sure there is any advantage to using IB.
>> On Wed, May 4, 2011 at 7:57 PM, kenlavigne <[hidden email]> wrote:
>>>
>>> ok, I think I'm ready to give up on IB. Is there somewhere on the web I
>>> haven't found where I can get a good example of creating interfaces with
>>> mt
>>> in code? I find some example doing it in xcode, but I'm new to this whole
>>> new apple world (down to the frustrating keyboard behaviour :( ). I just
>>> don't know enough about xcode or mt to look at an xcode example and
>>> convert
>>> it to mt. I was doing fine till I wanted to have a 3 tab controller,
>>> where
>>> tab 1 has a nav controller, tab 2 has a table view controller, and tab 3
>>> has
>>> another nav controller. I had the 1st 2 working fine. But as soon as I
>>> added
>>> the nav controller to the 3rd tab, it died. If i left it a
>>> UIViewController,
>>> it was ok. I then tried a new test project and got the same results. I
>>> was
>>> extremely careful to make sure I created the 3rd tabe exactly like the
>>> 1st.
>>> My root views were created identically. But as soon as I touch the 3rd
>>> tab,
>>> it dies with unrecognized selector sent to 0xetc. I would think that IB
>>> could handle this easily, but maybe I'm naive, or i'm just plain dumb.
>>>
>>> Thanks for your help.
>>>
>>> --
>>> View this message in context:
>>> http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3497225.html
>>> Sent from the MonoTouch mailing list archive at Nabble.com.
>>> _______________________________________________
>>> MonoTouch mailing list
>>> [hidden email]
>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>> _______________________________________________
>> MonoTouch mailing list
>> [hidden email]
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>> _______________________________________________
>> MonoTouch mailing list
>> [hidden email]
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>
> _______________________________________________ MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/ | http://www.flickr.com/photos/nicwise

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Ken Lavigne
That would be great. I'll take all the help I can get. I guess I haven't really ventured from the Microsoft world in about 15 years and it shows. This is my 1st excusion into apple territory ever.
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

David Moles
In reply to this post by Ken Lavigne
I dumped IB after about a week or ten days and haven't missed it -- the only annoying thing is the lack of automatic layout management. Haven't got a lot of sample code, and I haven't worked with tab controllers, but post your code and let's have a look.

It might be worth shoving your way through a couple of Objective-C tutorials just so you'll have an easier time reading sample code. I've had to write a few hundred lines of Obj-C now to use APIs that don't have MT bindings yet, and it's improved my Obj-C reading by leaps and bounds.

On Wed, May 4, 2011 at 5:57 PM, kenlavigne <[hidden email]> wrote:
ok, I think I'm ready to give up on IB. Is there somewhere on the web I
haven't found where I can get a good example of creating interfaces with mt
in code? I find some example doing it in xcode, but I'm new to this whole
new apple world (down to the frustrating keyboard behaviour :( ). I just
don't know enough about xcode or mt to look at an xcode example and convert
it to mt. I was doing fine till I wanted to have a 3 tab controller, where
tab 1 has a nav controller, tab 2 has a table view controller, and tab 3 has
another nav controller. I had the 1st 2 working fine. But as soon as I added
the nav controller to the 3rd tab, it died. If i left it a UIViewController,
it was ok. I then tried a new test project and got the same results. I was
extremely careful to make sure I created the 3rd tabe exactly like the 1st.
My root views were created identically. But as soon as I touch the 3rd tab,
it dies with unrecognized selector sent to 0xetc. I would think that IB
could handle this easily, but maybe I'm naive, or i'm just plain dumb.

Thanks for your help.

--
View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3497225.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch



--
David Moles

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Brent Schooley
What are you trying to do with IB that you can't figure out?  I'll see what I can put together for you (and in the process dodge the comments from martinbowling and chrisntr stating that I won't actually do it).

brent

Sent from my iPhone

On May 5, 2011, at 2:37 PM, David Moles <[hidden email]> wrote:

I dumped IB after about a week or ten days and haven't missed it -- the only annoying thing is the lack of automatic layout management. Haven't got a lot of sample code, and I haven't worked with tab controllers, but post your code and let's have a look.

It might be worth shoving your way through a couple of Objective-C tutorials just so you'll have an easier time reading sample code. I've had to write a few hundred lines of Obj-C now to use APIs that don't have MT bindings yet, and it's improved my Obj-C reading by leaps and bounds.

On Wed, May 4, 2011 at 5:57 PM, kenlavigne <[hidden email]> wrote:
ok, I think I'm ready to give up on IB. Is there somewhere on the web I
haven't found where I can get a good example of creating interfaces with mt
in code? I find some example doing it in xcode, but I'm new to this whole
new apple world (down to the frustrating keyboard behaviour :( ). I just
don't know enough about xcode or mt to look at an xcode example and convert
it to mt. I was doing fine till I wanted to have a 3 tab controller, where
tab 1 has a nav controller, tab 2 has a table view controller, and tab 3 has
another nav controller. I had the 1st 2 working fine. But as soon as I added
the nav controller to the 3rd tab, it died. If i left it a UIViewController,
it was ok. I then tried a new test project and got the same results. I was
extremely careful to make sure I created the 3rd tabe exactly like the 1st.
My root views were created identically. But as soon as I touch the 3rd tab,
it dies with unrecognized selector sent to 0xetc. I would think that IB
could handle this easily, but maybe I'm naive, or i'm just plain dumb.

Thanks for your help.

--
View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3497225.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch



--
David Moles
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch

_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Nic Wise
In reply to this post by Ken Lavigne
Give this a go:

https://gist.github.com/957668

it's 2 methods from 2 apps. I use MonoTouch.Dialog a LOT for most of
my UI's, but the same thing - new up a UILabel (etc) inside your
controller, and View.AddSubview(thelabel) etc works rather well.

Look up the difference between bounds and frame tho. Messes with my
head. I usually get it wrong.

On Thu, May 5, 2011 at 19:16, kenlavigne <[hidden email]> wrote:

> That would be great. I'll take all the help I can get. I guess I haven't
> really ventured from the Microsoft world in about 15 years and it shows.
> This is my 1st excusion into apple territory ever.
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3499084.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/ | http://www.flickr.com/photos/nicwise

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Fencer04
Forgive me for asking this, but what exactly does the Monotouch.Dialog library do. I haven't really checked it out since I'm fine with IB. What are the pros and cons of it?

Justin Hansen

On Thu, May 5, 2011 at 3:05 PM, Nic Wise <[hidden email]> wrote:
Give this a go:

https://gist.github.com/957668

it's 2 methods from 2 apps. I use MonoTouch.Dialog a LOT for most of
my UI's, but the same thing - new up a UILabel (etc) inside your
controller, and View.AddSubview(thelabel) etc works rather well.

Look up the difference between bounds and frame tho. Messes with my
head. I usually get it wrong.

On Thu, May 5, 2011 at 19:16, kenlavigne <[hidden email]> wrote:
> That would be great. I'll take all the help I can get. I guess I haven't
> really ventured from the Microsoft world in about 15 years and it shows.
> This is my 1st excusion into apple territory ever.
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/New-and-stuck-tp3468881p3499084.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



--
Nic Wise
t.  <a href="tel:%2B44%207788%20592%20806" value="+447788592806">+44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/ | http://www.flickr.com/photos/nicwise

mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2
_______________________________________________



--
Justin Hansen
http://www.klickwerx.com
Need some technology help? - http://www.betterfly.com/LearnTheWeb


_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|

Re: New and stuck

Ken Lavigne
In reply to this post by Brent Schooley
I finally got it working. I created a new navigation project and looked again at what code was generated. Where I had a UITableViewController in my XIB, they had just a UITableView. I changed my code to match and it worked. Are you not able to have a UITableViewController inside a UINavigationController?
Now you don't have to duck! :) martinbowling and chrisnte leave him alone! :)
12