Re: [MonoTouch] 100 times Adding / removing a View + backgroundImage will always crash !

2011-07-01 Thread Robert Jordan
On 01.07.2011 15:03, Jon Hopkins wrote:
> Hi,
>
>
>
> Calling this method on a timer will always eventually crash. GC is not
> working here, and I am
>
> Completely out of ideas.
>
...
>
> view.BackgroundColor =
> UIColor.FromPatternImage(UIImage.FromFile("assets/gallery/pic_" + idx +
> ".jpg"));
>

Try this:

using (var image = UIImage.FromFile(
"assets/gallery/pic_" + idx + ".jpg"))
using (var color = UIColor.FromPatternImage(image) {
view.BackgroundColor = color;
}


Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] direct to sql server

2011-07-16 Thread Robert Jordan
On 16.07.2011 05:04, Wally McClure wrote:
>
> I'm trying to connect a monotouch application directly to a sql
> server database.  I've added in what I think are the necessary
> namespaces into the project.  Unfortunately, when I connect to a sql
> server database, when I connect in the simulator to a sql server
> 2008r2 database, I get an exception stating that codepage 1252 is not
> supported.  I haven't had seen this in m4a in the .NET 4 client
> profile, so I'm a little surprised by it.  Any ideas or suggestions
> on it?  BTW, I know that a direct connection is not something
> everyone should do on a mobile device, however, this is a special
> case. Wally

Try to add more i18n assemblies with the iPhone settings options
of your project.

Robert
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] debugger issue

2011-07-29 Thread Robert Jordan
On 29.07.2011 12:59, helusoft wrote:
> Yesterday i updated to MD 2.6 B3 and MT 4.0.4.1 and all worked fine.
> But today, when i started MD to run a build to debug/simulater (debug/device
> too), i get this error:
> (i'm still working with OSX 10.6.x and Xcode 3.2.6)
>
> wrong package ? because on my machine, there is no /Users/michael/
> How do i fix this problem ???
>

Michael is the one who has built MD, and the debugging symbols
are containing his local file info that now shows up in stack traces.
There is no need to christian as Michael ;)

Clean up your bin folders, rebuild and retry.

Robert
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Wrong IP Address

2011-07-30 Thread Robert Jordan
On 30.07.2011 11:10, Greg wrote:
>
> IPhone IP : 192.168.37.11
> MBP: 192.168.37.12
> Debugger trying to connect to : 10.211.55.2
>
> Just dont know how or where the debugger is getting this address.

Did you recompile and redeploy the app after each change
of the network settings? The IP is burnt in the app at compile time.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Wrong IP Address

2011-08-01 Thread Robert Jordan
On 01.08.2011 15:55, Greg wrote:
> Any ideas or help are never useless. Unfortunately my IP Address is already
> reserved. It appears from Jeffs response that I simply will not be getting
> this working until the next release of MonoTouch (4.1) which just makes it
> very very difficult to test on the hardware as I have to write everything to
> a log and then when the app crashes get the log to see where it died and
> why, not very productive but when needs must

Out of curiosity, what's the output of /sbin/ifconfig on your system?

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Wrong IP Address

2011-08-01 Thread Robert Jordan
On 01.08.2011 16:24, Greg wrote:
> here is the content as requested, this as you can see is where i learnt that
> IP address is a virtual nic.

These are Parallels' NICs.

Try to put them down with

sudo /sbin/ifconfig vnic0 down
sudo /sbin/ifconfig vnic1 down

Then recompile, redeploy.

The NICs should be up again after the next reboot, or just turn them
on with

sudo /sbin/ifconfig vnic0 up
sudo /sbin/ifconfig vnic1 up

if it didn't help.

Robert


>
> lo0: flags=8049 mtu 16384
>   options=3
>   inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
>   inet 127.0.0.1 netmask 0xff00
>   inet6 ::1 prefixlen 128
> gif0: flags=8010 mtu 1280
> stf0: flags=0<>  mtu 1280
> en0: flags=8863 mtu 1500
>   options=2b
>   ether c4:2c:03:00:a8:73
>   inet6 fe80::c62c:3ff:fe00:a873%en0 prefixlen 64 scopeid 0x4
>   inet 192.168.3.168 netmask 0xff00 broadcast 192.168.3.255
>   media: autoselect (100baseTX)
>   status: active
> en1: flags=8823 mtu 1500
>   ether 90:27:e4:f2:c9:d9
>   media: autoselect ()
>   status: inactive
> fw0: flags=8863 mtu 4078
>   lladdr e8:06:88:ff:fe:b6:85:7a
>   media: autoselect
>   status: inactive
> p2p0: flags=8802 mtu 2304
>   ether 02:27:e4:f2:c9:d9
>   media: autoselect
>   status: inactive
> vnic0: flags=8843 mtu 1500
>   options=3
>   ether 00:1c:42:00:00:08
>   inet6 fe80::21c:42ff:fe00:8%vnic0 prefixlen 64 scopeid 0x8
>   inet 10.211.55.2 netmask 0xff00 broadcast 10.211.55.255
>   inet6 ::0.0.0.2 prefixlen 64
>   media: autoselect
>   status: active
> vnic1: flags=8843 mtu 1500
>   options=3
>   ether 00:1c:42:00:00:09
>   inet6 fe80::21c:42ff:fe00:9%vnic1 prefixlen 64 scopeid 0x9
>   inet 10.37.129.2 netmask 0xff00 broadcast 10.37.129.255
>   inet6 ::0.0.0.2 prefixlen 64
>   media: autoselect
>   status: active
>
> Thanks
>
> Greg
>
> --
> View this message in context: 
> http://monotouch.2284126.n4.nabble.com/Wrong-IP-Address-tp3704536p3709789.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> ___
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Send mail System.Net.Mail on monotouch

2011-08-01 Thread Robert Jordan
On 01.08.2011 17:11, Anita V. wrote:
> Does this code work if you run it from a desktop application? Does it work on
> the iPhone simulator?

I don't know if System.Net.Mail is part of the monotouch profile,
but System.Net.Mail in a desktop or even mobile application is
of almost no use.

You'd had to ask the user to provide a server host name, username,
password, email, etc. Then you'd have to store this info *safely*.

Or you could store the credentials of your own mail server in
the app. Not quite secure, IMHO.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Performance cost of MonoTouch vs. Objective-C

2011-08-10 Thread Robert Jordan
On 10.08.2011 12:48, Jon Hopkins wrote:
> The bottom line is we have no real benchmarks. 1:1 code mapping can prove 
> some things, but
> Its not a given that there is no performance difference, yet.
> I would like to see some hard figures that do show this, to convince clients 
> that there is no
> Reason to use objective c over monotouch.

 From a client's point of view, there are many other reasons to force
Obj-C on contractors. Presenting them some questionable micro
benchmarks won't change their mind at all, if they aren't
completely clueless.

But you can always score with MonoTouch' ability to deliver in time,
and with the option to handle more platforms (Microsoft, Android,
iOS). This is a unique selling point.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Performance cost of MonoTouch vs. Objective-C

2011-08-10 Thread Robert Jordan
On 10.08.2011 14:39, kbudris wrote:
> I've only worked with MonoTouch so far... haven't yet needed to work on
> Microsoft or Android devices. Just how portable is a MonoTouch app to
> Android? I can see where I might be able to reuse the data model, but the
> entire presentation layer seems so Apple-specific. Wouldn't the entire UI
> need to be scrapped and rewritten for Android?

The presentation layer needs to be rewritten according to the
device's own user interface guides. That's the philosophy
behind Mono{Touch|Droid}.

The other option would be to develop in Obj-C, Java and C# using
different tools and reusing ~nothing.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Invo

2011-08-11 Thread Robert Jordan
On 11.08.2011 21:13, Matteo Polito wrote:
> Hi,
>
> why if I execute this code my app freeze? To use again my app I need to
> close and reopen it. I've used this code(threadpool and ManualResetEvent)
> because I need to execute a method on thread but I need to wait its
> completion.
>
> var resetEvent = new ManualResetEvent(false);
> ThreadPool.QueueUserWorkItem(
>  arg =>
>  {
> this.InvokeOnMainThread(delegate
>  {
> UIAlertView _AlertView = new UIAlertView("Test", "Test", null, "OK", null);
> _AlertView.Show();
> });
>  resetEvent.Set();
>  });
> resetEvent.WaitOne();
>
>
> Do you know why?
>

The main thread is blocked by resetEvent.WaitOne(), and
InvokeOnMainThread is probably crashing because of this.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] App crashing on iOS 3.1.2

2011-08-19 Thread Robert Jordan
On 19.08.2011 17:08, Anita H. wrote:
> Hi,
>
> I was wondering if Monotouch apps support iOS 3.1.2? My app works great on
> all iOS 4 devices, but runs slowly and crashes halfway through the game on
> an iPhone 1 running iOS 3.1.2. Unfortunately, I haven't been able to debug
> the crash yet, because I can only borrow this iPhone 1 for a short time, and
> I don't have access to wireless at the moment. Has anyone experienced
> similar issues? Based on the app behavior and the time of the crash, my gut
> is telling me that the app is crashing when the garbage collector is called,
> but I haven't been able to debug and confirm.

iPhone 1 and 3G only have ~50MB of available memory
in the best case. This is less than the half of the memory
available on 3GS and less than a forth of an iPhone 4.

If you didn't develop for (and test on) these elder devices,
you should rather not support them at all.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Different sort of AlertView

2011-08-26 Thread Robert Jordan
On 26.08.2011 18:20, Dean Cleaver wrote:
> I'm looking to implement the type of alert view that appears when you click 
> "Mark" (among other things) in emails - where it slides up from the bottom 
> with various buttons (the UIAlertView can really only come with 4 buttons 
> total - 4 (plus cancel) and it starts messing up).
>
> Is there an existing class that supports this - I'm unsure of the terms to 
> search on, and have found nothing?
>

This is a UIActionSheet, a class supported by MT.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Close an application definitively

2011-08-27 Thread Robert Jordan
On 27.08.2011 01:25, catullum wrote:
> I need that my application should be closed by an button.
>
> but it should be closed definitively.
> The application dose some thing on start that it dosed when you press only
> the home button.

As Jason wrote, Apple will likely reject such an app.

Add this to your Info.plist if you want this behavior:

UIApplicationExitsOnSuspend


Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Close an application definitively

2011-08-27 Thread Robert Jordan
On 27.08.2011 15:06, Robert Jordan wrote:
> On 27.08.2011 01:25, catullum wrote:
>> I need that my application should be closed by an button.
>>
>> but it should be closed definitively.
>> The application dose some thing on start that it dosed when you press only
>> the home button.
>
> As Jason wrote, Apple will likely reject such an app.
>
> Add this to your Info.plist if you want this behavior:
>
> UIApplicationExitsOnSuspend
> 

Oops, this was misleading. Adding the key won't lead to a rejection.
It's the supported way of telling iOS that the app doesn't need
backgrounding.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] WebView Double Tab

2011-08-28 Thread Robert Jordan
On 27.08.2011 16:25, Roeland wrote:

> I'm trying to do the same thing in MonoTouch, but I can't get it to work.
> 
>   public class HtmlContentControl : UIWebView
>   {
> // .
>   public override UIView HitTest (PointF point, UIEvent uievent) {
>   var result = base.HitTest (point, uievent);
>   
>   NSSet touches = uievent.AllTouches;

Try this instead of Enumerate():

bool forwardToSuper = true;
foreach (var touch in touches.ToArray()) {
if (touch.TapCount >= 2)
forwardToSuper = false;
}

if (forwardToSuper)
result = base.HitTest (point, uievent);
else
result = this.SuperView;

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Close an application definitively

2011-08-28 Thread Robert Jordan
On 27.08.2011 19:20, catullum wrote:
> Ok it works fine.
> thanks.
> but is there a way to do it with an UIButton ?

Did you try Environment.Exit(0)?

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] sqlite insert works on the simulator but not on the device

2011-08-31 Thread Robert Jordan
On 31.08.2011 11:51, catullum wrote:
> I have a sql command that works on the simulator but not on the device.
>
> i tried similar constructs but nothing is working.
>
> this was my original:
>
>   connection = new SqliteConnection ("Data Source=" + 
> dbPath);
>   connection.Open ();

You are not closing the connection, at least not in this code snippet.
Also, what is dbPath? You don't try to write to a DB inside your
app bundle, do you?

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] sqlite insert works on the simulator but not on the device

2011-08-31 Thread Robert Jordan
On 31.08.2011 13:32, catullum wrote:
> Ok thanks but please tell me how can i say to the monodevelop that the sqlite
> files gos to the documents folder durin the compilation?

There is no way to deploy directly into the Documents or Library
folders.

You should check if the DB file already exists. If not, then you
copy the file from the app bundle into the desired location.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


[MonoTouch] Thoughts on Localization

2011-09-02 Thread Robert Jordan
Hi,

Currently, there is no distinguished support for locales in MonoTouch.
Even basic things, like setting the current locale from iOS' own,
are not provided. Although they are quite easy to implement
by the developer, at least some basic support would be useful. W/out
some runtime support in this area, developers are forced to set the
locale on every thread they create or use (thread pool).

For L11n string lookups, it would be nice to have a static
method or string extension that invokes

NSBundle.MainBundle.LocalizedString.

Although this is also trivial to implement by each developer,
an official method would help develop/reuse gettext-like tools.

Robert
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] How do I handle AppStore reject because of crash

2011-09-07 Thread Robert Jordan
On 07.09.2011 19:28, Mark Handzlik wrote:
> Hello I submitted first monotouch app to Appstore and it was rejected because 
> of
> crash. They sent back 5 crash files but I have no clue as to how to match 
> these
> up with Monotouch code to be able to determine where app crashed. App has been
> running fine with 50+ users deployed via TestFlight.
> Below is part of one of the iPad crash reports. Can you help me in what I need
> to do to find out where in my App the crash occurred?
> Thanks.

If you still have a "MobileForce3.MonoTouch.app.dSYM" folder
that exactly matches the app you've uploaded into the store,
then the following steps should resolve the symbols:

1) copy the crash dumps into the parent folder, so it looks
like this:

MobileForce3.MonoTouch.app
MobileForce3.MonoTouch.app.dSYM
dump1.crash
dump2.crash
...

2) invoke symbolicatecrash from a terminal:

cd /path/of/the/folder/above

/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/Current/Resources/symbolicatecrash
 
-A -v dump1.crash .

(Notice the trailing  )

3) inspect the output. Repeat with the next crash dump.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Just upgraded MonoTouch and MonoDevelop, MD now crashes on startup

2011-09-13 Thread Robert Jordan
On 13.09.2011 10:52, tomf84 wrote:
> Indeed, upgrading Mono to 2.10.5 fixes it. Surprised there's no warning about
> this in the upgrade notes visible in MonoDevelop.

Actually, I've got an error message about the missing Mono 2.10.5
but it showed up only after I've restarted MonoDevelop 2.6 twice.
The first time it beach-balled (or bounced) and I killed it; the
2nd time it presented a nice error message.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] uninstalling MT

2011-09-13 Thread Robert Jordan
On 13.09.2011 10:59, Nic Wise wrote:
> Anyone know how to do this properly?
>
> I need to reinstall clean, to try to fix a different problem. (
> http://bugzilla.xamarin.com/show_bug.cgi?id=709 )

sudo rm -rf /Developer/MonoTouch

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Problem on application start

2011-09-19 Thread Robert Jordan
On 19.09.2011 11:58, pkd2010 wrote:
> Hi
>
> i am currently working with MonoTouch. everything is good except a problem
> that i have in my applications. each MonoTouch application that i want to
> run on iOS Device. before my application starts it waits 0.5 to 1.5 seconds
> on a black screen and after that vibrates on iPhone them my application
> starts. can anyone please help me solve this problem?

This is the debugger that tries to connect to MonoDevelop.
You can solve this either by disabling debugging in your
app's settings (on the iOS device) or by installing
"Release" builds.

Robert


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] System.Net.NetworkInformation.Ping not supported in MT?

2011-09-19 Thread Robert Jordan
On 19.09.2011 16:04, jowi wrote:
>
> Nic Wise wrote:
>>
>> There is a fair bit of the normal framework which has been removed,
>> and I think sockets (which would be required for ping) is one of them
>>
> Sockets are implemented thru System.Net.Sockets; i've been using this for
> sending messages over ip allready. Ping is in System.Net.NetworkInformation.
>
> What i find strange is that the actual code compiles, and code completion
> recognizes it, and the code actually runs... if this is stripped from the
> library, my code should give a build error and should not run, or am i
> mistaken?

The Mac OSX implementation of S.N.NI.Ping is simply invoking the
`ping' executable. I doubt this is supported under iOS.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Problem adding settings to my app using root.plist

2011-09-21 Thread Robert Jordan
On 21.09.2011 09:48, pkd2010 wrote:
> Hi
>
> i have made a new folder "settings.bundle" and in this folder i have made a
> root.plist (standard xml file) and made my settings in there just like
> tutorials but they won't show, in fact the debugger settings come. how to
> solve this problem?

It's "Settings.bundle" and "Root.plist". Pay attention to the casing
and set Root.plist's build action to "Content".

Robert


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] How to load NSURL which contains hash fragment “#” with UIWebView?

2011-09-28 Thread Robert Jordan
On 27.09.2011 12:10, Builder wrote:
> Hello,
>
> I have a problem to load URL containing fragment into UIWebView. I want to
> load a local html file into UIWebView. I tried to do it in this way:
>
> NSUrl url = NSUrl.FromFilename(@"/Users/gep/Library/Application
> Support/iPhone
> Simulator/4.3/Applications/582D1D4E-9496-4352-8CE1-8520A842FBA8/Documents/Content/Hermes_filter/Ergaenzendes/index.htm#home");
>
> But without any success. But when I used url without fragment, it worked
> correctly:

NSUrl.FromFile does exactly what it was told to do: If you specify
"index.htm#home", it will assume you want the *file* with the name
"index.htm#home". The same applies to query params (?foo=bar&bazz).

Try

NSUrl.FromString(NSUrl.FromFile("index.html").AbsoluteString + "#home");

I did not test it, but I believe .AbsoluteString will return a
file-schema URL, which you can feed to NSUrl.FromString together
with the trailing fragment.

Robert


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Change URL of webservice during runtime

2011-09-29 Thread Robert Jordan
On 29.09.2011 14:26, Andreas Ploetzeneder wrote:
> hello,
> how can i change the url of a webservice while the service is running

If you're using plain old web service proxies (non WCF), then
the URL can be changed with the "Url" property of the proxy.

For WCF see Sebastien's answer.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Strange error compiling

2011-10-02 Thread Robert Jordan
On 02.10.2011 17:05, fmuaddib wrote:
> MonoDevelop started giving me this error very often:
>
> Error 1: mtouch failed with the following message:
> /Developer/usr/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/as: can't
> fork a new process to execute:
> /Developer/usr/bin/../libexec/gcc/darwin/i386/as (Resource temporarily
> unavailable)

Your machine is running out of resources.

See 
http://blog.ghostinthemachines.com/2010/01/19/mac-os-x-fork-resource-temporarily-unavailable/

Robert
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Can not resolve reference: System.Boolean System.Double::op_Inequality(System.Double, System.Double)

2011-10-03 Thread Robert Jordan
On 03.10.2011 15:06, Hugo Logmans wrote:
> Hi all,
>
> I'm using Monodevelop 2.6b1 with Delphi Prism on MacOSX, latest monotouch
> version. When linking, or when not linking but running the app, I get
> missing methods errors. Googling around, most of the time the problem is a
> certain user library is not linked against Monotouch. But in this case it's
> a very simple program and no user libraries are used (except maybe Delphi
> Prism is a user library).
>
> Also the strange thing is it always are internal methods like op_Inequality,
> so I cannot add [preserve] to them.
>
> Could not link assemblies: Mono.Linker.ResolutionException: Can not resolve
> reference: System.Boolean
> System.Double::op_Inequality(System.Double,System.Double)
>
> And two others: Double::op_Lessthan and Typeinfo.Equality. As my program is
> growing, I might encounter more of them...
>
> Maybe anybody has a clue as where to search for the cause of this problem?
> Or is it solely a Prism bug?


System.Double::op_Inequality(System.Double,System.Double) is a
method introduced with .NET 4.0 that doesn't exist in the
Silverlight profile used by MonoTouch.

To make it short: you can't take a library compiled against
some random desktop profiles and hope that it will just work
under MonoTouch.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Problem with uitableviewcell

2011-10-08 Thread Robert Jordan
On 08.10.2011 10:47, Andreas Ploetzeneder wrote:
> Hi,
> I get the exception Datasource must return a cell. in uitableviewcell

You get this because the Cell property is null.

See 
http://www.alexyork.net/blog/post/Creating-Custom-UITableViewCells-with-MonoTouch-the-correct-way.aspx

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Problems with OpenFlowSharp

2011-10-08 Thread Robert Jordan
On 08.10.2011 11:38, Andreas Ploetzeneder wrote:
> Hi,
> does anybody get the https://github.com/migueldeicaza/OpenFlowSharp working?
>
> My one crashes when starting?

You should first explain what "my one" means. Do you mean the
sample or something else?

FWIW, OpenFlowSharp (the assembly) is working fine for me.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] 100% NullReferenceException in HttpWebRequest.GetRequestStream()

2011-10-10 Thread Robert Jordan
Hi Will,

On 09.10.2011 21:40, Will Stones wrote:
> Since upgrading to MonoTouch 4.2.2 and MonoDevelop 2.8 I'm experience a 100%
> NullReferenceException when making a call to
> HttpWebRequest.GetRequestStream() when running on an iOS 3.1.3 device.  I've
> pasted the exception trace below.
>
> The code which reproduces the exception is as follows:
>  HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
>  request.UserAgent = "MyUserAgent";
>  request.Timeout = 15000;
>  request.KeepAlive = true;
>  request.Method = "POST";
>  string requestString = GetQueryString();
>  byte[] postBytes = Encoding.ASCII.GetBytes(requestString);
>  request.ContentLength = postBytes.Length;
>  request.ContentType = "application/x-www-form-urlencoded";
>  // Crashes on this line
>  request.GetRequestStream().Write(postBytes, 0, postBytes.Length);
>
>
> The code used to work fine until I upgraded MT and MD (I'm afraid I've lost
> the installers for the versions I was using so I can't tell you when the
> problem was introduced).
>
> This issue is pretty critical for me...!  Can anyone confirm how long a fix
> for an issue like this is likely to take?  If you'd like any more info on
> this please let me know.

This looks like a bug in MT 4.2 new feature: "iOS Proxy support: we now 
pick the system proxy settings and use those in .NET APIs.  The new 
CFProxy type can be used to get to all the details."

As a workaround, try to set request's Proxy property like this:

request.Proxy =  GlobalProxySelection.GetEmptyWebProxy();

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] 100% NullReferenceException in HttpWebRequest.GetRequestStream()

2011-10-10 Thread Robert Jordan
On 10.10.2011 13:56, Will Stones wrote:
> Hi Robert,
>
> Thanks for the quick reply, I'll give this a try.  If I do make this change
> is it likely to have any side effects?  Such as the request failing if the
> user is using a HTTP proxy in their system settings?

Yes, but these settings were not taken into account until MT 4.2,
and the Earth is still spinning ;)

You could do it conditionally (only on iOS < 4).

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Can't determine IP address on iPhone device

2011-10-15 Thread Robert Jordan
On 15.10.2011 10:02, jowi wrote:
> Thanks Miguel, that does the trick! I leave it up to you guys to find out why
> the other code doesn't. Should i file a bug report for it?

Your code isn't correct because it assumes that your device has
a valid (resolvable) host name. Also, you're deliberately appending
".local" to your host name. This is obviously wrong.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Leftbarbutton with peak

2011-10-17 Thread Robert Jordan
On 16.10.2011 22:33, Andreas Ploetzeneder wrote:
> Hi,
> how can i make the Leftbarbutton, of a UINavigationitem to have a peak?
> without using uinavigationcontroller?
>
> this.NavigationItem.LeftBarButtonItem=new UIBarButtonItem (new
> UIImage("Images/home.png"),UIBarButtonItemStyle.Bordered,back);

I've seen solutions/hacks for this on stackoverflow.

You may want to search for "leftBarButtonItem and arrow",
because I don't believe "peak" is the correct notation of
the arrow.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] ViewDidAppear() not called after app entering foreground?

2011-10-17 Thread Robert Jordan
On 17.10.2011 09:18, jowi wrote:
> In the different (tab)views, i use the ViewDidLoad() for initializing stuff
> and ViewDidAppear() for (re)loading data etc. This all works very nice at
> runtime. But i noticed that if the app is in the background, and i put it
> back to the foreground, the AppDelegate's WillEnterForeground() is called,
> but NOT the active view's ViewDidAppear(). Is this normal behaviour? Because
> i need to refresh some specific view-dependent data when i enter from
> background.

This is by design. You must either broadcast a notification to
your current view or use NSNotificationCenter to monitor
UIApplication.WillEnterForegroundNotification from inside the view.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] URGENT Project with webservice cannot be opened any more

2011-10-17 Thread Robert Jordan
On 17.10.2011 15:38, Andreas Ploetzeneder wrote:
> Hi,
> now i cannot open it any more, my project, which contains a "not actiual"
> webservice.

If it's so urgent, why don't you provide more information?
What does "cannot be opened" mean? What's the error message,
MD log etc.? What's a "not actual webservice"?

Anyway, open the solution with an editor and remove the
offending project manually.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] URGENT Project with webservice cannot be opened any more

2011-10-17 Thread Robert Jordan
On 17.10.2011 16:07, Andreas Plötzeneder wrote:
> Solution contains only one project so removing makes mo sense

Assuming that you have a non WCF web service reference,
open the project file (csproj) with an editor and look for the
CS file of the proxy, e.g.:

 
   Reference.map
 

Then remove the DependentUpon element.

Robert

>
> Am 17.10.2011 um 15:50 schrieb Robert Jordan:
>
>> On 17.10.2011 15:38, Andreas Ploetzeneder wrote:
>>> Hi,
>>> now i cannot open it any more, my project, which contains a "not actiual"
>>> webservice.
>>
>> If it's so urgent, why don't you provide more information?
>> What does "cannot be opened" mean? What's the error message,
>> MD log etc.? What's a "not actual webservice"?
>>
>> Anyway, open the solution with an editor and remove the
>> offending project manually.
>>
>> Robert
>>
>> ___
>> MonoTouch mailing list
>> MonoTouch@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] URGENT Project with webservice cannot be opened any more

2011-10-17 Thread Robert Jordan
On 17.10.2011 17:56, Andreas Ploetzeneder wrote:
> ok   thx, but how do i now remove and readd the webreference , i guess the
> problem is, that the webreference is not actual any more. but i cannot
> update it,.because this means crash than.

Click on "Web References" in the solution tree, right-click the
URL and chose "Delete".

Or open the csproj file with an editor and remove the
appropriate WebReferenceUrl element. If you only want to
change the URI: use search-and-replace.

Adding a web reference: right-click on the project in the
solution tree, chose "Add" then "Add Web Reference".

Robert

>
> 2011/10/17 Robert Jordan
>
>> On 17.10.2011 16:07, Andreas Plötzeneder wrote:
>>> Solution contains only one project so removing makes mo sense
>>
>> Assuming that you have a non WCF web service reference,
>> open the project file (csproj) with an editor and look for the
>> CS file of the proxy, e.g.:
>>
>>  
>>Reference.map
>>  
>>
>> Then remove the DependentUpon element.
>>
>> Robert
>>
>>>
>>> Am 17.10.2011 um 15:50 schrieb Robert Jordan:
>>>
>>>> On 17.10.2011 15:38, Andreas Ploetzeneder wrote:
>>>>> Hi,
>>>>> now i cannot open it any more, my project, which contains a "not
>> actiual"
>>>>> webservice.
>>>>
>>>> If it's so urgent, why don't you provide more information?
>>>> What does "cannot be opened" mean? What's the error message,
>>>> MD log etc.? What's a "not actual webservice"?
>>>>
>>>> Anyway, open the solution with an editor and remove the
>>>> offending project manually.
>>>>
>>>> Robert
>>>>
>>>> ___
>>>> MonoTouch mailing list
>>>> MonoTouch@lists.ximian.com
>>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>>
>>
>> ___
>> MonoTouch mailing list
>> MonoTouch@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>
>
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] install ios 4 sdk without uninstalling iOS 5

2011-10-17 Thread Robert Jordan
On 17.10.2011 22:03, Brian Newton wrote:
> Yeah, in general how do you support multiple versions of iOS? When I go into
> the project properties all I can select is 5.0, which from what I can tell
> makes it so people without 5.0 can't even install it even if I'm not using
> any 5.0 specific tech.

You can specify a different (e.g. a much lower) iOS *deployment target*
version in the "iPhone Application" tab of the project options.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Missing Backbutton when Pushing Viewcontroller

2011-10-20 Thread Robert Jordan
On 19.10.2011 18:39, Andreas Ploetzeneder wrote:
> Hi,
> i do not see the Backbutton in uinavigationcontroller
> i push the following class:
>
> public class LoginViewController : DialogViewController
>
> {
>
> public LoginViewController () : base (null)


public LoginViewController () : base (null, true)


Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] objectc

2011-10-20 Thread Robert Jordan
On 20.10.2011 12:10, Peter Garner wrote:
> Does anyone know if I you can import an objective c class into
> monodevelop and use and call the methods using c#. I have a class
> written in object but would like to Use this in my monotouch
> application

http://docs.xamarin.com/ios/advanced_topics/binding_objective-c_types

Robert
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Missing Beginnconnect in sockets, Bug?

2011-10-22 Thread Robert Jordan
On 22.10.2011 13:48, Andreas Ploetzeneder wrote:
> Hi,
> could it be that there is missing the beginnconect of sockets:
>
> I get "system.net.sockets.socket does not contain a definition for
> beginconnect" but i see it, as an option to program...

Please paste the exact error message. The compiler does not
convert type and method names to lower case. Also, you've
managed to show us 3 different spellings for BeginConnect.
Odds are there is a fourth one in your actual code ;)

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Change url of webreference

2011-10-23 Thread Robert Jordan
On 23.10.2011 13:25, Andreas Ploetzeneder wrote:
> hi,
> how can i programatically change the url of a webreference during runtime

var srv = new SomeWebReference();
srv.Url = "http://another.uri.comes.here";;

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Change url of webreference

2011-10-23 Thread Robert Jordan
On 23.10.2011 15:25, Andreas Ploetzeneder wrote:
> Thank you robert, for your Feedback
>
> Regarding coloring the Font Color of the navigationbar, i get "unrecognized
> selector sent to instance". Can the reason be, that it just works on ios5?

Oops, sorry. textAttributes/SetTextAttributes is only available
in iOS 5:

https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UINavigationBar_Class/Reference/UINavigationBar.html

But you can replace the title view of the bar with a label
that can be customized:

using (var label = new UILabel()) {
label.Text = NavigationItem.Title;
label.TextColor = UIColor.White;
label.BackgroundColor = UIColor.Clear;
// replace the title view of the current nav item:
NavigationItem.TitleView = label;
label.SizeToFit();
}

Robert

>
>
>
>
>>
>> public override void ViewDidLoad ()
>> {
>> base.ViewDidLoad ();
>>
>> // Hintergrundfarbe:
>> NavigationController.**NavigationBar.TintColor = UIColor.Red;
>>
>> // Texteigenschaften:
>> var textAttr = new UITextAttributes();
>> textAttr.TextColor = UIColor.White;
>>
>> // Texteigenschaften des Titels setzen:
>> NavigationController.**NavigationBar
>> .SetTitleTextAttributes(**textAttr);
>>
>> }
>>
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Do the makers of Monodevelop actually test the application?

2011-10-24 Thread Robert Jordan
Well, did you missed the Novell/Attachmate debacle and the
more or less forced transition to XCode 4?

You seem to have problems with the debugger. Okay, that's
unfortunate, but:

1) Debugging is working on the simulator just fine.

2) If you see that a feature is not working properly,
then you should file bugs and stop using it until it's
fixed. It's really that simple ;)

3) The whole Mono BCL (millions of LOC) was written
w/out a debugger, and the folks who wrote it are still
alive. Try to change your workflow, debug less,
use Console.WriteLine, etc. It really works and it's by
far faster than using a debugger (especially when it takes
40 minutes as in your case ;)).

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Please advise wrt two apps with same source files

2011-10-24 Thread Robert Jordan
Hi,

Starting with MD 2.8, the application ID and other iOS application
settings are only stored in Info.plist.

Changing the application ID (and maybe the app name at
your choice) in this file is enough to create a lite (or pro)
version of your app, because your app can query the application
ID[1] and branch accordingly at run-time.

When I'm about to build the lite version, I'm temporarily
overwriting Info.plist with InfoLite.plist and I'm done.
(It's actually scripted, but it really doesn't matter).


With MD 2.4/MT 3, I had this layout:

Project/
Project/AppName.sln
Project/AppNameLite.sln
Project/AppName/AppName.csproj
Project/AppName/AppNameLite.csproj

AppNameLite.sln was a copy of AppName.sln in which the
string AppName.csproj was replaced with AppNameLite.csproj.

AppNameLite.csproj was a copy AppName.csproj with
a different  element.

Whenever AppName.csproj has been changed, I've merged the
changes into AppNameLite.csproj using the merge facility of
my version control system.

Robert

[1]
string appId = (string) NSBundle.MainBundle.
 InfoDictionary[new NSString("CFBundleIdentifier")];


On 24.10.2011 18:09, Guido Van Hoecke wrote:
> Hi Michael,
>
> I did not try it for the data files, but my experience with hard links for the
> shared sources wasn't that good. Whenever a source get's rewritten, a new file
> is created, breaking the hardlink and ending up with two separate non-linked 
> and
> out-of-sync files.
>
> Guido.
>
> On Mon, Oct 24, 2011 at 17:15, Michael S. Muegel  wrote:
>> iOS is not my day job so I won't be able to look @ this until later in the
>> evening. You mentioned linking directories. Did you try a "hard link"
>> between directories? "ln source alias" I can't see how MonoDevelop would
>> know that these are different. Not sure how this would impact source code
>> management, however.
>>
>> -Mike
>>
>> On Mon, Oct 24, 2011 at 9:44 AM, Guido Van Hoecke  wrote:
>>> The symlink approach does not work. Monodevelop does not allow to assign
>>> icons
>>> if they are included in the project as symlinks. So I duplicated the image
>>> and
>>> data dirs in the two app project dirs. However the apps still don't build.
>>>
>>> Anyone?
>>>
>>> TIA, Guido
>>>
>>> On Mon, Oct 24, 2011 at 14:15, Guido Van Hoecke  wrote:
 Gents,

 (Same message, minor corrections)

 Using your fine ideas (thanx) I now
 - created a Library project within the Solution,
 - referenced it from both apps
 - moved all common sources to the Library project
 - moved common images and app data directories to the Library project
 - symlinked to these directories from the app project directories
 - included these (symlink) data and image directories and files in the
 projects
 - set the build action for these image and data files to nothing in
 the Library project
 - set it to content in the app projects

 Ready to build:

 - library project compiles without probs
 - the app projects main compilation: build complete: -- 0 errors, 0
 warnings
 - compiling to native code fails for both apps with:
 - "Error: root assembly does not exist
 /Users/guivho/solution/App1/bin/$(Target)/$(Configuration)/App1.exe"
 or
 /Users/guivho/solution/App2/bin/$(Target)/$(Configuration)/App2.exe"

 Any idea why mtouch fails? This is the build output (using -v -v -v)
 (target iPhone/release, App1):

 /Developer/MonoTouch/usr/bin/mtouch -v --nomanifest --nosign
 -dev "/Users/guivho/Mono/Solution/App1/bin/$(Target)/Release/App1.app"
 -r "/Users/guivho/Mono/Solution/Library/bin/Release/Library.dll"
 -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll"
 -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll"
 -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll"
 -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll"
 -linksdkonly
 -sdk "4.3"
 -targetver "3.0"
 -v -v -v -gcc_flags  "-framework MediaPlayer -framework AudioToolbox
 -framework CoreGraphics
 -framework QuartzCore -framework MessageUI -framework SystemConfiguration
 -L/Users/guivho/Mono/Solution/App1
 -lGoogleAdMobAds
 -force_load /Users/guivho/Mono/Solution/App1/libGoogleAdMobAds.a"
 "/Users/guivho/Mono/Solution/App1/bin/$(Target)/Release/App1.exe"

 Framework is:
 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk

 Error: root assembly does not exist
 /Users/guivho/Mono/solution/App1/bin/iPhone/Release/App1.exe

 mtouch exited with code 1

 I get the same error for both the iPhone and iPhoneSimulator target and
 Debug,
 Release, Distribution configurations.

 Any ideas or suggestions? I'd like to stick to this setup, but it's
 got to work off course...

 TIA, Guido.

 On Mon, Oct 24, 2011 at 09:40, David Black
 wrote:
>
> Hi Michael
>
> It's also worth noting that t

Re: [MonoTouch] xcode 4.2 and external libraries

2011-10-25 Thread Robert Jordan
Hi,

Mono's LLVM backend is entirely independent from Apple's compiler.
You don't need to enable Mono's LLVM to be able to link native
libraries created with Apple's compiler, and vice versa.

Robert

On 25.10.2011 20:36, Shawn Baker wrote:
> After installing Xcode 4.2, I noticed that it only supports two C/C++
> compilers, "Apple LLVM compiler 3.0" and "LLVM GCC 4.2". As far as I can
> tell, plain old "GCC 4.2" is no longer available. Our product uses several
> C/C++/Obj-C libraries that are built with Xcode, all linked into a large UI
> written in C#. It seems to me that the only way this is going to work is if
> I configure my C# project with "Use LLVM optimizing compiler". But if I do
> that, I can't use the debugger. Furthermore, decades of programming
> experience have left me extremely hesitant to trust anything marked as
> experimental.
>
> So, am I missing something? Is there a way to do this and still have
> debugging? Is MT's LLVM support "really" experimental and/or is that going
> to change any time soon?
>
> I'm really not sure where to go from here, so I'm still working with Xcode
> 4.1 for now.
>
>
> --
> View this message in context: 
> http://monotouch.2284126.n4.nabble.com/xcode-4-2-and-external-libraries-tp3937760p3937760.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> ___
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Webservice no internet connection

2011-10-28 Thread Robert Jordan
On 28.10.2011 13:01, simarx wrote:
>
> Nic Wise wrote:
>>
>> It should throw an exception. Or it will time out.
>>
>> Do the call in another thread, and then have yet another thread
>> watching it if its a problem. You should not be doing the webservice
>> call on the UI thread anyway...
>
> Doing a web-service call onthe UI thread should be ok if you intend the app
> to block during the call? i.e. where the user is carrying out an action that
> requires it to complete before they move on?

No, it's not okay. You should deactivate the UI, e.g. by showing an
activity indicator on top of an alert view, and perform the WS call
from another thread.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Third argument Presentviewcontroller

2011-10-31 Thread Robert Jordan
On 31.10.2011 18:48, Andreas Ploetzeneder wrote:
> Hi,
> i want to call splitviewcontroller.PresentViewController  ,
> splitviewcontroller is an UISplitviewcontroller
>
> what is the third argument, i have to call? can u show me an example?

It's a simple delegate, so you could pass `delegate {}' as the 3rd
parameter, if null isn't allowed. The docs say otherwise:

http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW75

So please file a bug if passing delegate {} is fixing your issue.

Robert


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Third argument Presentviewcontroller

2011-10-31 Thread Robert Jordan
On 31.10.2011 19:56, Andreas Ploetzeneder wrote:
> null is not allowed,i get a crash if i make third argument null but for
> what do i need it  ?

 From the docs I've posted below: "The completion handler is called
after the viewDidAppear: method is called on the presented view
controller."

> so third argument can be "delegate{};"?

Yes.

splitviewcontroller.PresentViewController(
   someController,
   true,
   delegate {}
   );

>
>
>
> 2011/10/31 Robert Jordan
>
>> On 31.10.2011 18:48, Andreas Ploetzeneder wrote:
>>> Hi,
>>> i want to call splitviewcontroller.PresentViewController  ,
>>> splitviewcontroller is an UISplitviewcontroller
>>>
>>> what is the third argument, i have to call? can u show me an example?
>>
>> It's a simple delegate, so you could pass `delegate {}' as the 3rd
>> parameter, if null isn't allowed. The docs say otherwise:
>>
>>
>> http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW75
>>
>> So please file a bug if passing delegate {} is fixing your issue.
>>
>> Robert
>>
>>
>> ___
>> MonoTouch mailing list
>> MonoTouch@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>
>
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Third argument Presentviewcontroller

2011-10-31 Thread Robert Jordan
On 31.10.2011 20:25, Andreas Ploetzeneder wrote:
> i get
>   MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.
> Name: NSInvalidArgumentException Reason: -[S3G.MySplitViewController
> presentViewController:animated:completion:]: unrecognized selector sent to
> instance 0x72d3300

This is an iOS 5 API. You want PresentModalViewController.

Robert


>
> 2011/10/31 Robert Jordan
>
>> On 31.10.2011 19:56, Andreas Ploetzeneder wrote:
>>> null is not allowed,i get a crash if i make third argument null but
>> for
>>> what do i need it  ?
>>
>>From the docs I've posted below: "The completion handler is called
>> after the viewDidAppear: method is called on the presented view
>> controller."
>>
>>> so third argument can be "delegate{};"?
>>
>> Yes.
>>
>> splitviewcontroller.PresentViewController(
>>someController,
>>true,
>>delegate {}
>>);
>>
>>>
>>>
>>>
>>> 2011/10/31 Robert Jordan
>>>
>>>> On 31.10.2011 18:48, Andreas Ploetzeneder wrote:
>>>>> Hi,
>>>>> i want to call splitviewcontroller.PresentViewController  ,
>>>>> splitviewcontroller is an UISplitviewcontroller
>>>>>
>>>>> what is the third argument, i have to call? can u show me an example?
>>>>
>>>> It's a simple delegate, so you could pass `delegate {}' as the 3rd
>>>> parameter, if null isn't allowed. The docs say otherwise:
>>>>
>>>>
>>>>
>> http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW75
>>>>
>>>> So please file a bug if passing delegate {} is fixing your issue.
>>>>
>>>> Robert
>>>>
>>>>
>>>> ___
>>>> MonoTouch mailing list
>>>> MonoTouch@lists.ximian.com
>>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>>>
>>>
>>>
>>>
>>
>> ___
>> MonoTouch mailing list
>> MonoTouch@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>
>
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] A question about storyboards...

2011-11-01 Thread Robert Jordan
On 01.11.2011 17:14, BradThor wrote:
> My question is, what would I give up using storyboards over XIBs? I am
> working with a c# programmer on translating our SL/Wp7 app into an
> iPhone/iPad app... and I want to make sure we arent limiting our target
> audience, or my programmer's options with using Storyboards...

Storyboards are only for iOS 5.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Proper UIViewController/UIView handeling

2011-11-01 Thread Robert Jordan
On 01.11.2011 18:42, shawnlehner wrote:
> Thanks for the reply!
>
> This is what I expected but my tests say otherwise. I performed a few very
> crude tests and it does not appear that the View is being released. Here is
> what I did ...
>
> In the ViewDidLoad I created a WeakReference to the view and stored it for
> later. When the DidReceiveMemoryWarning I invoked the following code:
>
> t = NSTimer.CreateRepeatingScheduledTimer(0.1, delegate {
>   Console.WriteLine(wr.IsAlive);
>   });
>
> This results in wr.IsAlive returning true consistently.

If the view controller is still visible, iOS won't call ViewDidUnload
nor destroy its view. Try to bury it under a navigation controller
by pushing another view controller above it.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Proper UIViewController/UIView handeling

2011-11-01 Thread Robert Jordan
On 01.11.2011 20:50, shawnlehner wrote:
> I am actually using a custom navigation controller which inherits from
> UIViewController. The navigation structure inside my application is unique
> and didn't fit well into the normal nav controller. Should I subclass from
> this anyway even though I will not be using virtually any of the
> functionality?

I didn't mean you should actually use a navigation controller for
other purposes than debugging how ViewDidUnload really works
in a test application. I was under the impression you were testing...

Since you're using a custom UIViewController, you can simply
monitor DidReceiveMemoryWarning and decide what to do, regardless
of ViewDidUnload's occurrence.

Robert
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] UISplitviewcontroller in Portrait Mode

2011-11-01 Thread Robert Jordan
On 01.11.2011 21:30, Andreas Ploetzeneder wrote:
> Hi,
> is it possible to use UISplitviewcontroller in Portrait Mode with Menu on
> the left!


No, but you could use this fine replacement:

https://github.com/Krumelur/MTSplitViewController

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] UISplitviewcontroller in Portrait Mode

2011-11-01 Thread Robert Jordan
On 01.11.2011 22:14, Shawn Baker wrote:
> If your program's target is iOS 5.0, then yes, it is possible. You
> would override ShouldHideViewController and return false for the left
> hand view controller. I found that I had to set the WeakDelegate in
> my UISplitViewController derived class in order to get
> ShouldHideViewController to be called.
>
> If you can't do 5.0 then MTSplitViewController is probably your best
> alternative, although the author says it has some resizing bugs.

MTSplitViewController works like a charm for me.

I've found only one serious issue that affected resizing when
MTSplitViewController is hosted inside a Navigation-
or TabBarController:

https://github.com/robert-j/MTSplitViewController/commit/e0242f5937f5759719fb79766c2736ece4d0fb60

The other issue is caused by iOS's lack of containment support
The InterfaceOrientation property of the model and detail
controllers does not reflect the actual orientation anymore,
because MTSplitViewController cannot update it (it's read-only).

Other than that, MTSplitViewController simply rocks.

Robert
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Proper UIViewController/UIView handeling

2011-11-02 Thread Robert Jordan
On 02.11.2011 09:05, Ivan Nikitin wrote:
>> The test code from my previous post is run as described. I understand that
> the delegate { } call will cause by view controller to be referenced; this
> is desired. Even though my VC is referenced I expect that the view, which
> my WeakReference is targeting, should be removed at some point.
>
> That's the problem. You confused C# runtime and iOS SDK. WeakReference and
> hard references are C# objects. iOS knows nothing if it is a hard reference
> or a weak reference - it lives its own life. WeakReference tells GC it can
> collect this object if there are no other hard references to it. Since
> there is one (delegate), this will never happen.

That's not the real issue. When an ObjC property like "View"
is accessed, MonoTouch will store its .NET representation in a
backer field of the controller:

object viewBacker;
UIView View {
 get {
 viewBacker = get_objc_object(...);
 return (UIView) viewBacker;
 }
}

This means that a WeakReference taken from "controller.View"
will remain alive as long as the controller isn't GCed, or
until "controller.View" is invoked again and its value has
actually changed.

If you don't poll controller.View periodically you won't be
able to detect when it's set to null by Cocoa. But in this
case ViewDidUnload will be called anyway. However, this happens
only in emergency cases, so you can't rely on it.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] MT.Dialog Content size.

2011-11-02 Thread Robert Jordan
On 02.11.2011 10:07, Mittchel Van Vliet wrote:
> Hello everyone,
>
> I'm almost done with my view and it looks nearly perfect! There is just one
> slight problem that I'm facing.
> Using MonoTouch.Dialog I made some tableview items which the user can fill
> in.
> Below the tableview there is a GlassButton that is also made with
> MT.Dialog.. when I add this Button the view like this:
>
> DialogViewController dv = new DialogViewController(root, false);
> dv.View.Add(glassButton);
> NavigationController.PushViewController(dv, false);
>
> It works fine in Portrait mode.. but as I turn it into landscape mode the
> search button finds itself under the TabBarController.. and if I scroll
> down I can't scroll that far until my GlassButton is shown.. how can I fix
> this?
>
> I hope someone can assist me with this!

If you add views like this, then it's your responsibility to align
them when the orientation changes.

Did you consider adding an MT.Dialog.Element descendant  that contains
your glass button to the DialogViewController?

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] LeftBarButton Color

2011-11-03 Thread Robert Jordan
On 03.11.2011 16:13, Andreas Ploetzeneder wrote:
> Hello,
> I want to color the textcolor of the leftbarbutton, when going back.

You probably want to set the color of the BackBarButtonItem.
A back bar button is that one with the left-pointing arrow.

Robert

>
> i tried the following:
>
> var textAttr = new UITextAttributes();
>
> textAttr.TextColor = UIColor.Red;
>
>this
> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Application);
>
>this
> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Disabled);
>
>this
> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Highlighted);
>
>this
> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Normal);
>
>this
> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Reserved);
>
>this
> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Selected);
>
>
> Any ideas?
>
>
>
> 2011/10/23 Robert Jordan
>
>> On 23.10.2011 13:41, Andreas Ploetzeneder wrote:
>>
>>> ok, great, maybe you can help me 3 more things :)
>>> 1. how can i add password /username if the folder https protected with
>>> password?
>>>
>>
>> var srv = new SomeWebReference();
>> srv.Credentials = new NetworkCredential("name", "password");
>> 
>>
>>
>>   2. have you got a code for an uinavigationbar, to recolor it, that the
>>> fonttext and buttontext is all dark instead of white
>>>
>>
>> Wenn du das aus einem ViewController heraus machen willst, der auf
>> einen NavigationController gepusht wird:
>>
>> public override void ViewDidLoad ()
>> {
>> base.ViewDidLoad ();
>>
>> // Hintergrundfarbe:
>> NavigationController.**NavigationBar.TintColor = UIColor.Red;
>>
>> // Texteigenschaften:
>> var textAttr = new UITextAttributes();
>> textAttr.TextColor = UIColor.White;
>>
>> // Texteigenschaften des Titels setzen:
>> NavigationController.**NavigationBar
>> .SetTitleTextAttributes(**textAttr);
>>
>> }
>>
>>
>>
>>   3. do you know a monotouch lib for graphs?
>>>
>>
>> Z.B. CorePlot: 
>> http://tirania.org/monomac/**archive/2011/Jan-01.html<http://tirania.org/monomac/archive/2011/Jan-01.html>
>>
>>
>>   4. have you got a donate button somewhere...thx for your great help!
>>>
>>
>> Ne, das mache ich nur zum Spaß :)
>>
>> Bitte beim nächsten mal an die Mailinglist schreiben, damit
>> andere auch was davon haben.
>>
>> ciao
>> Robert
>>
>>
>>
>>
>>>
>>>
>>> 2011/10/23 Robert Jordan
>>>
>>>   On 23.10.2011 13:25, Andreas Ploetzeneder wrote:
>>>>
>>>>> hi,
>>>>> how can i programatically change the url of a webreference during
>>>>> runtime
>>>>>
>>>>
>>>> var srv = new SomeWebReference();
>>>> srv.Url = "http://another.uri.comes.here**";;
>>>>
>>>> Robert
>>>>
>>>> __**_
>>>> MonoTouch mailing list
>>>> MonoTouch@lists.ximian.com
>>>> http://lists.ximian.com/**mailman/listinfo/monotouch<http://lists.ximian.com/mailman/listinfo/monotouch>
>>>>
>>>>
>>>
>>>
>>>
>>
>
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] LeftBarButton Color

2011-11-03 Thread Robert Jordan
On 03.11.2011 16:42, Andreas Ploetzeneder wrote:
> yes :)
> but it does not work

Try this:

var attr = new UITextAttributes();
attr.TextColor = UIColor.Red;
UIBarButtonItem item = new UIBarButtonItem();
item.Title = Title;
item.SetTitleTextAttributes(attr, UIControlState.Normal);
NavigationItem.BackBarButtonItem = item;

Robert

>
> 2011/11/3 Robert Jordan
>
>> On 03.11.2011 16:13, Andreas Ploetzeneder wrote:
>>> Hello,
>>> I want to color the textcolor of the leftbarbutton, when going back.
>>
>> You probably want to set the color of the BackBarButtonItem.
>> A back bar button is that one with the left-pointing arrow.
>>
>> Robert
>>
>>>
>>> i tried the following:
>>>
>>>  var textAttr = new UITextAttributes();
>>>
>>>  textAttr.TextColor = UIColor.Red;
>>>
>>> this
>>>
>> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Application);
>>>
>>> this
>>>
>> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Disabled);
>>>
>>> this
>>>
>> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Highlighted);
>>>
>>> this
>>>
>> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Normal);
>>>
>>>     this
>>>
>> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Reserved);
>>>
>>> this
>>>
>> .NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(textAttr,UIControlState.Selected);
>>>
>>>
>>> Any ideas?
>>>
>>>
>>>
>>> 2011/10/23 Robert Jordan
>>>
>>>> On 23.10.2011 13:41, Andreas Ploetzeneder wrote:
>>>>
>>>>> ok, great, maybe you can help me 3 more things :)
>>>>> 1. how can i add password /username if the folder https protected with
>>>>> password?
>>>>>
>>>>
>>>> var srv = new SomeWebReference();
>>>> srv.Credentials = new NetworkCredential("name", "password");
>>>> 
>>>>
>>>>
>>>>2. have you got a code for an uinavigationbar, to recolor it, that the
>>>>> fonttext and buttontext is all dark instead of white
>>>>>
>>>>
>>>> Wenn du das aus einem ViewController heraus machen willst, der auf
>>>> einen NavigationController gepusht wird:
>>>>
>>>> public override void ViewDidLoad ()
>>>> {
>>>>  base.ViewDidLoad ();
>>>>
>>>>  // Hintergrundfarbe:
>>>>  NavigationController.**NavigationBar.TintColor = UIColor.Red;
>>>>
>>>>  // Texteigenschaften:
>>>>  var textAttr = new UITextAttributes();
>>>>  textAttr.TextColor = UIColor.White;
>>>>
>>>>  // Texteigenschaften des Titels setzen:
>>>>  NavigationController.**NavigationBar
>>>>  .SetTitleTextAttributes(**textAttr);
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>>3. do you know a monotouch lib for graphs?
>>>>>
>>>>
>>>> Z.B. CorePlot: http://tirania.org/monomac/**archive/2011/Jan-01.html<
>> http://tirania.org/monomac/archive/2011/Jan-01.html>
>>>>
>>>>
>>>>4. have you got a donate button somewhere...thx for your great help!
>>>>>
>>>>
>>>> Ne, das mache ich nur zum Spaß :)
>>>>
>>>> Bitte beim nächsten mal an die Mailinglist schreiben, damit
>>>> andere auch was davon haben.
>>>>
>>>> ciao
>>>> Robert
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>> 2011/10/23 Robert Jordan
>>>>>
>>>>>On 23.10.2011 13:25, Andreas Ploetzeneder wrote:
>>>>>>
>>>>>>> hi,
>>>>>>> how can i programatically change the url of a webreference during
>>>>>>> runtime
>>>>>>>
>>>>>>
>>>>>> var srv = new SomeWebReference();
>>>>>> srv.Url = "http://another.uri.comes.here**";;
>>>>>>
>>>>>> Robert
>>>>>>
>>>>>> __**_
>>>>>> MonoTouch mailing list
>>>>>> MonoTouch@lists.ximian.com
>>>>>> http://lists.ximian.com/**mailman/listinfo/monotouch<
>> http://lists.ximian.com/mailman/listinfo/monotouch>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>> ___
>> MonoTouch mailing list
>> MonoTouch@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>
>
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] LeftBarButton Color

2011-11-03 Thread Robert Jordan
On 03.11.2011 18:22, Karl Heinz Brehme Arredondo wrote:
> Trying buttons myself on Toolbar on Interface Builder of Xcode 4, on iOS 5
> it can have different background colors. But running on iOS 4 is get the
> default color defined by toolbar background color. On what iOS versio are
> you testing?

This is the new appearance API of iOS 5. Andreas already knew this.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] BeforeCodeSign Project Operation phase for custom commands

2011-11-04 Thread Robert Jordan
On 04.11.2011 09:48, Guido Van Hoecke wrote:
>
> I welcome the community's opinion about this suggestion.

I would like it, although "AfterBuild" must remain as is, because
many people use it to upload/copy the app at this stage.

'BeforeCodeSign' makes sense.

Robert


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] 5.0.2?

2011-11-04 Thread Robert Jordan
On 04.11.2011 20:59, Nic Wise wrote:
> I love it how it's not 8pm on a friday night in the US yet... :)

But beware of those rusty trampolines! I heard they don't take
weekends into account, nor do they like rushed releases
on Friday afternoon ;)

Happy Friday!

>
> On Fri, Nov 4, 2011 at 19:50, Jeff Stedfast  wrote:
>> It's being pushed now, yea.
>> Scramble the downloaders!
>>
>> Jeff
>>
>> On Fri, Nov 4, 2011 at 3:46 PM, Wally McClure
>>   wrote:
>>>
>>> Did I read that 5.0.2 is now out?
>>>
>>> ___
>>> MonoTouch mailing list
>>> MonoTouch@lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>>
>>
>>
>> ___
>> MonoTouch mailing list
>> MonoTouch@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>>
>
>
>

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Anonymous methods clarification...

2011-11-04 Thread Robert Jordan
On 04.11.2011 23:48, Dominique Louis wrote:
>   foreach (KeyValuePair  item in murderStats)
>   {
>   var se = new StringElement(item.Key,
> item.Value.ToString());
>   se.Tapped += delegate {
>   StatisticsDrillDownMap( se ); // This works...
>   StatisticsDrillDownMap( se.Caption ); // This does
> NOT work, and only holds the last item.Key
>   };
>   sec.Add(se);
>   }

Could it be that you wanted to write that

StatisticsDrillDownMap(item.Key)

doesn't work? Indeed, this is by design.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Anonymous methods clarification...

2011-11-05 Thread Robert Jordan
On 05.11.2011 10:26, Dominique Louis wrote:
> Robert inside the constructor of StringElement(), item.Key and
> se.Caption are exactly the same value.
>
> I'm still no 100% this is by design, unless you were joking.

You didn't answer my question. It's crucial to know if you
were using the loop variable ("item") inside the delegate,
as this is the only source of such problems.

See Eric Lippert's article. He's one of the C# fathers
and he's definitely not joking:

http://blogs.msdn.com/b/ericlippert/archive/2009/11/12/closing-over-the-loop-variable-considered-harmful.aspx

Robert


>
> D.
>
> On Sat, 05 Nov 2011 01:01:33, Robert Jordan  wrote:
>> 04.11.2011 23:48, Dominique Louis wrote:
>>> foreach (KeyValuePairitem in murderStats)
>>> {
>>> var se = new StringElement(item.Key,
>>> item.Value.ToString());
>>> se.Tapped += delegate {
>>> StatisticsDrillDownMap( se ); // This works...
>>> StatisticsDrillDownMap( se.Caption ); // This does
>>> NOT work, and only holds the last item.Key
>>> };
>>> sec.Add(se);
>>> }
>> Could it be that you wanted to write that
>>
>>  StatisticsDrillDownMap(item.Key)
>>
>> doesn't work? Indeed, this is by design.
>>
>> Robert
> ___
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>


-- 
:: AMMMa AG
:: Fon: +49 521 96878-0   mailto:r...@ammma.de
:: Fax: +49 521 96878-20  http://www.ammma.de
:: Firmensitz: Ritterstr. 19, 33602 Bielefeld
:: Registergericht: Amtsgericht Bielefeld, HRB 36772
:: Vorstand: Olaf Schneider, Robert von Donop
:: Vorstandsvorsitzender: Volker Wittenbröker
:: Aufsichtsratsvorsitzender: Karl-Hermann Böker
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] problem with colored title

2011-11-07 Thread Robert Jordan
On 07.11.2011 20:22, Andreas Ploetzeneder wrote:
> The text loooks unsharp.

UITextAttributes has more than one property. One of them
is called TextShadowColor. Guess what is this used for :)

Robert

>
> 2011/11/7 Andreas Plötzeneder
>
>> It should have no shadow
>>
>> Am 07.11.2011 um 15:51 schrieb Tomasz Cielecki:
>>
>>> What result did you expect. Please elaborate.
>>>
>>> On Mon, Nov 7, 2011 at 2:22 PM, Andreas Ploetzeneder
>>>   wrote:
 Hello,
>>  // Hintergrundfarbe:
>>  NavigationController.**NavigationBar.TintColor = UIColor.Red;
>>
>>  // Texteigenschaften:
>>  var textAttr = new UITextAttributes();
>>  textAttr.TextColor = UIColor.White;
>>
>>  // Texteigenschaften des Titels setzen:
>>  NavigationController.**NavigationBar
>>  .SetTitleTextAttributes(**textAttr);
 is not sharpthe text of the title seems to have a shadow,... any
>> ideas
 ___
 MonoTouch mailing list
 MonoTouch@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/monotouch


>>>
>>>
>>>
>>> --
>>> Med Venlig Hilsen / With Best Regards
>>> Tomasz Cielecki
>>> http://ostebaronen.dk
>>>
>>
>
>
>
>
>


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] the requested operation cannot be completed because...

2011-11-08 Thread Robert Jordan
On 09.11.2011 00:01, sisnaz wrote:
> I really could use some help with this one. I keep seeing this message for
> each property in my class:
> "the requested operation cannot be completed because the object has been
> garbage collected."

Where do you see this message? While debugging?

> In my web service:

Web service? Do you mean web service *client*?

> StreamReader results = new StreamReader(answer);
> string peopleData = results.ReadToEnd();
>
> // everything is fine until I get here, once it's serialized from Json, I
> have 9 records with null properties.
> List  people =
> DataHelper.SerializeFromJson>(peopleData);

What does DataHelper.SerializeFromJson? Are you sure that it's
deserializing correctly?

>
> The Model:
> [Serializable]
> public class PeopleModel {

> Just thought of something while typing all this in, I have other methods in
> my web service returning similar list of models, the only difference is this
> I recently decorated with [Serializable] because I wanted to persist it to a
> binary file after retrieval from the web service. Could that be making the
> GC want to collect it prematurely?

Not really, but did you remove it to see if it's the cause
of the problem?

Robert


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Remove Notification from the Notification List

2011-11-09 Thread Robert Jordan
On 09.11.2011 10:18, Andreas Ploetzeneder wrote:
> Hi,
> when my app runs in background, how can i manage,...that the push
> notification will be Removed from the notification Center when starting
> "activating the app".
>
> So when app runs in background, and i bring it forward, i would like to
> remove the notification from the notification center.

Do you override ReceivedLocalNotification in your AppDelegate?
If you do this, the notification should be removed automatically.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Could not create sound ID for ....

2011-11-09 Thread Robert Jordan
On 09.11.2011 11:41, Andreas Ploetzeneder wrote:
> Hi,
> i call:
>
>   var audioPlayer = new SystemSound(new
> NSURL(NSBundle.MainBundle.Bundleurl+"CLICK18C.caf");
>
>  if (audioPlayer != null)
>
>  {
>
> audioPlayer.PlaySystemSound();
>
>  }
>
> The source worked before,...now i Get System.InvalidOpetaionException Could
> not create system sound ID for url file://.

The error message is usually including the cause of the error...
Please copy&paste these messages next time.


> The file is a caf,
> the filename is case sensitivly correct
> the file is embedded as Resource...

The file must not be embedded as "Resource". Its build action must be 
set to "Content".

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Get MAC address

2011-11-12 Thread Robert Jordan
On 12.11.2011 18:30, Derik Palacino wrote:

> I should also mention that this is not an "Emulator Only Issue", I had hoped
> that it was, but that exact same results (different address of course) are
> present on the device in both iOS 4.3 and 5.0. I'll post back if I find a
> better way of getting the MAC address through MonoTouch.

Please file a bug and mention that Mono for MacOS has the same issue:

using System;
using System.Net.NetworkInformation;

class Test
{
static void Main ()
{
foreach (var i in NetworkInterface.GetAllNetworkInterfaces()) {
Console.WriteLine ("{0} {1}",
i.Id,
i.GetPhysicalAddress());
}
}
}

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Unlock event?

2011-11-13 Thread Robert Jordan
On 13.11.2011 13:46, jowi wrote:
> My app needs to update itself after it has become active etc. I use the
> WillEnterForegroundNotification and the ViewDidLoad and ViewDidAppear
> functions to accomplish this in the view, and also the WillEnterForeground
> in the AppDelegate, and it all works fine.
>
> Except for one situation, and that is when the device gets locked when my
> app is active. Once you unlock the device by sliding the 'slide to unlock'
> at the front, the app is still there, but it does not get any of the
> previously mentioned notifications.

You may want to override OnActivated in your AppDelegate.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] A problem with UIDevice.CurrentDevice.Orientation

2011-11-23 Thread Robert Jordan
On 23.11.2011 13:54, pkd2010 wrote:
> Hi
>
> I have a view in my form that must be hidden in Portrait Mode and must be
> visible in Landscape mode.
> I made the following code:
>
> switch(UIDevice.CurrentDevice.Orientation)
> {
> case UIDeviceOrientation.LandscapeLeft:
> case UIDeviceOrientation.LandscapeRight:
>   myView.Hidden=false;
>
> case UIDeviceOrientation.Portrait:
> case UIDeviceOrientation.PortraitUpSideDown:
>   myView.Hidden=true;
> }
>
> but i have a problem because there are two Orientations also, FaceUp and
> Unknown.
> My application won't work on them because I don't know whether iOS is in
> Landscape or Portrait. I am looking for another way to get what is the iOS
> Rotation not Device Orientation.

You're confusing device orientation with interface orientation.
The latter can be obtained from the InterfaceOrientation property
of every UIViewController descendant.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] why no invokeonmainthread

2011-11-23 Thread Robert Jordan
On 23.11.2011 18:06, Wally McClure wrote:
>
> I just wrote the code below.  I am wondering why I did not have to
> call InvokeOnMainThread when I added my map view annotation point(s).
> Seems like the geocode complete handler would be on a background
> thread when it completes.  Is this blind luck that it runs, only runs
> in the emulator, or does this need a InvokeOnMainThread so that it
> hits the ui thread?

 From Apple's docs of geocodeAddressString:completionHandler:

"This method submits the specified location data to the geocoding server 
asynchronously and returns. Your completion handler block will be 
executed on the main thread."


Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Puzzled with deployment targets and iOS 5 behavior

2011-11-30 Thread Robert Jordan
On 30.11.2011 20:17, René Ruppert wrote:
> But I guess I will not be able to submit my app then...AFAIK Apple requires
> you to use the latest SDK, or am I wrong?
>
> In to get a bit more details and to stick with my example: where is the code
> of UIView.AddSubview()? Is it part of the app I compile or is it always a
> call to the operating system? If it’s part of the app I wonder how a simple
> ObjC app can be 50kb or less.

It's part of UIKit.

> But if it is not, why and how could it matter which SDK I’m using when
> building?

Apple is able to check which version of the SDK your app was
compiled against. If < 5.0 is detected, viewWillAppear won't
be called, because it would break existing apps.

Note that even you set deployment target to 4.3, your app is
still compiled against 5.0. The only way to force a 4.3 behavior
is to compile against this SDK version.

Robert


>
>
>
> René
>
>
>
> Von: Rolf Bjarne Kvinge [mailto:r...@xamarin.com]
> Gesendet: Mittwoch, 30. November 2011 12:54
> An: René Ruppert
> Cc: MonoTouch Forums
> Betreff: Re: [MonoTouch] Puzzled with deployment targets and iOS 5 behavior
>
>
>
> Hi René,
>
>
>
> It's not easy to have a general rule for differences between iOS versions or
> differences between SDK versions. The logical assumption is that installing
> an app built with 4.3 on an iOS5 device should still work - but there are of
> course exceptions to this assumption (which can be both bugs in iOS5,
> MonoTouch or actually documented behavior). This means that an app built
> with the 4.3 SDK will generally work identically on iOS 4.3 and 5.
>
>
>
> HoweverI find that the easiest way to figure it out is to try it yourself:
> install the 4.3 SDK and build with it to see what happens. My guess is that
> you'll see the same behavior on both iOS5 and 4.3 devices, but it's still
> just a guess..
>
>
>
> I hope this helps,
>
> Rolf
>
>
>
>
>
> On Tue, Nov 29, 2011 at 7:57 PM, René Ruppert
> wrote:
>
> Hi,
>
> I have ios SDK 5 installed, nothing else.
> I'm using MT5.0.2.
> My selected SDK is 5, my deployment target is 4.3
>
> Now: I add a s controller's view as subview to a view of another controller.
> If I run the code on an iOS 5 device, ViewWillAppear() triggers for the
> controller whose view gets added.
> Running the same on an iOS 4 device does not trigger it.
>
> As I want to support 4.3 and want the event handlers to be called I will
> have to trigger them manually. But this will trigger them twice on ios 5 if
> I do not run a version check before my calls.
>
> Now I'm wondering: if I reinstall SDK 4.3 and build my app using that, will
> it behave identically on both devices or will I still have the issue because
> one device is 5 and the other is 4.3? Or is the actual version of the OS of
> no meaning in this scenario?
>
> What role does the actual OS version play?
>
> Grüße, René
> ___
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
>
>
>
>
>


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] binding my own protocol

2011-12-07 Thread Robert Jordan
On 07.12.2011 12:52, Nic Wise wrote:
> Hi there.
>
> I've been reading this:
> http://docs.xamarin.com/ios/tutorials/Events%2c_Protocols_and_Delegates
>
> Am I correct in thinking I can make my own abstract class for a
> protocol I want to use (UIAccessability in this case):
>
> [Register("UIAccessability", Model]
> public abstract class UIAccessability : NSObject
> {
>//methods and bindings using [Export] in here
>public virtual string AccessabilityLabel {
>  [Export("accessibilityLabel")]get;
>  [Export("setAccessibilityLabel:")]set;
>}
> }
>
> Then, on a button, I could do:
>
> UIButton button = whatever's needed to set it up
>
> var acc = button as UIAccessability;
>
> if (acc != null)
>acc.AccessabilityLabel = "foo!";
>
> etc
>
> Correct? No need to btouch it, as I'm not bringing in a new library -
> it's all in UIKit??

Since UIAccessibility is an informal protocol, Obj-C classes
don't adopt it, and direct bindings won't work as expected
anyway.

Try this extension class:

http://pastebin.com/0bqJaP0B


Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Localization of system controls

2011-12-07 Thread Robert Jordan
Hi,

On 07.12.2011 19:00, johnHolmes wrote:
> I'have recently developed a small application using monotouch. The
> applications works fine except I'm unable to have "system" or "specialized"
> controls like UITabBarItems or MFMailComposeViewController localized
> (translated) in languages other then English. My testing device is an
> iphone4 and is configured to use Italian as culture. The application runs
> fine, but titles of UITabBarItems or the buttons of the
> MFMailComposeViewController still show English text. How to have them
> translated in Italian?

Add this to your Info.plist using a text editor:

 CFBundleDevelopmentRegion
 it

Previous MonoDevelop versions used to have GUI for this setting (IIRC),
but I can't find it anymore. Maybe it got lost during the redesign
of the Info.plist editor...

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Localization of system controls

2011-12-07 Thread Robert Jordan
On 07.12.2011 19:44, Robert Jordan wrote:
> Hi,
>
> On 07.12.2011 19:00, johnHolmes wrote:
>> I'have recently developed a small application using monotouch. The
>> applications works fine except I'm unable to have "system" or "specialized"
>> controls like UITabBarItems or MFMailComposeViewController localized
>> (translated) in languages other then English. My testing device is an
>> iphone4 and is configured to use Italian as culture. The application runs
>> fine, but titles of UITabBarItems or the buttons of the
>> MFMailComposeViewController still show English text. How to have them
>> translated in Italian?
>
> Add this to your Info.plist using a text editor:
>
>   CFBundleDevelopmentRegion
>   it
>
> Previous MonoDevelop versions used to have GUI for this setting (IIRC),
> but I can't find it anymore. Maybe it got lost during the redesign
> of the Info.plist editor...

Ah, it can be added with the "Advanced" tab of the "iPhone Application"
settings. Go figure ;)

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Exception: JIT Compile

2011-12-09 Thread Robert Jordan
On 09.12.2011 16:27, Mittchel debaass wrote:
> Hello everyone,
>
> Recently I converted Twitterizer to MonoTouch and tested it on the
> emulator. This worked fine, though when I am testing it on the device it
> goes terribly wrong.
> I am getting two JIT Compile errors in 2 different method, the code can be
> found here: http://pastebin.com/05hcLBRH
>
> What's going wrong? why does it work in the emulator and fails it badly on
> the device?

It due to this limitation:

http://docs.xamarin.com/ios/about/limitations#Value_types_as_Dictionary_Keys

Even you don't use dictionaries directly, Linq might still need an
IEqualityComparer for a value type TKey.

Try to rewrite Linq query, especially the orderby clause:

var paramsSorted = from p in parameters
orderby p.Key, p.Value
select p;

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] QLPreviewController in Monotouch

2011-12-12 Thread Robert Jordan
On 12.12.2011 12:50, Alexander wrote:
> I want to open PDF files using QLPreviewController in Monotouch, but I can't
> to do this.
> QLPreviewItem is an abstract class, but object of this type returns method :
> QLPreviewControllerDataSource.GetPreviewItem(QLPreviewController, int)

You're supposed to subclass QLPreviewItem, and then return such
object from GetPreviewItem:

public class MyItem : QLPreviewItem
{
string title;
Uri uri;

public MyItem(string title, Uri uri)
{
this.title = title;
this.uri = uri;
}

public override string ItemTitle {
get { return title; }
}

public override NSUrl ItemUrl {
get { return uri; }
}
}

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Third argument Presentviewcontroller

2011-12-14 Thread Robert Jordan
Hi,

you can check the iOS version at run-time:

if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0)) {
// call API for iOS >= 5.0
} else {
// alternative
}

Robert

On 14.12.2011 06:35, Xy wrote:
> Hi Robert,
>
> Would still be great if you could tell us how to call such a method
> correctly. There are other similar methods in iOS 5API, such as
> DismissViewController. We probably should start using them soon.
>
> Thanks,
> XY
>
>
> Robert Jordan wrote
>>
>> On 31.10.2011 20:25, Andreas Ploetzeneder wrote:
>>> i get
>>>MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.
>>> Name: NSInvalidArgumentException Reason: -[S3G.MySplitViewController
>>> presentViewController:animated:completion:]: unrecognized selector sent
>>> to
>>> instance 0x72d3300
>>
>> This is an iOS 5 API. You want PresentModalViewController.
>>
>> Robert
>>
>>
>>>
>>> 2011/10/31 Robert Jordan<robertj@>
>>>
>>>> On 31.10.2011 19:56, Andreas Ploetzeneder wrote:
>>>>> null is not allowed,i get a crash if i make third argument null but
>>>> for
>>>>> what do i need it  ?
>>>>
>>>>  From the docs I've posted below: "The completion handler is called
>>>> after the viewDidAppear: method is called on the presented view
>>>> controller."
>>>>
>>>>> so third argument can be "delegate{};"?
>>>>
>>>> Yes.
>>>>
>>>> splitviewcontroller.PresentViewController(
>>>> someController,
>>>> true,
>>>> delegate {}
>>>> );
>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2011/10/31 Robert Jordan<robertj@>
>>>>>
>>>>>> On 31.10.2011 18:48, Andreas Ploetzeneder wrote:
>>>>>>> Hi,
>>>>>>> i want to call splitviewcontroller.PresentViewController  ,
>>>>>>> splitviewcontroller is an UISplitviewcontroller
>>>>>>>
>>>>>>> what is the third argument, i have to call? can u show me an example?
>>>>>>
>>>>>> It's a simple delegate, so you could pass `delegate {}' as the 3rd
>>>>>> parameter, if null isn't allowed. The docs say otherwise:
>>>>>>
>>>>>>
>>>>>>
>>>> http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW75
>>>>>>
>>>>>> So please file a bug if passing delegate {} is fixing your issue.
>>>>>>
>>>>>> Robert
>>>>>>
>>>>>>
>>>>>> ___
>>>>>> MonoTouch mailing list
>>>>>> MonoTouch@.ximian
>>>>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> ___
>>>> MonoTouch mailing list
>>>> MonoTouch@.ximian
>>>> http://lists.ximian.com/mailman/listinfo/monotouch
>>>>
>>>
>>>
>>>
>>
>> ___
>> MonoTouch mailing list
>> MonoTouch@.ximian
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>
>
> --
> View this message in context: 
> http://monotouch.2284126.n4.nabble.com/Third-argument-Presentviewcontroller-tp3956583p4193760.html
> Sent from the MonoTouch mailing list archive at Nabble.com.


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Socket Connection

2011-12-17 Thread Robert Jordan
On 17.12.2011 12:19, akobold wrote:
> //the DataReceived function is called only one, for the first packet and
> nothing else

It's called as often as you call BeginReceive. If don't call
BeginReceive again in the callback, no more data will be received.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] iPod Touch unhappy with use of RightBarButtonItems

2011-12-17 Thread Robert Jordan
On 17.12.2011 02:50, jlindborg wrote:
> UIBarButtonItem _addButton = new UIBarButtonItem (UIImage.FromBundle
> ("Images/more_24.png"), UIBarButtonItemStyle.Plain,
> Handle_AddNewPrivateRecordingClicked);
>
> UIBarButtonItem _editButton = new UIBarButtonItem (UIImage.FromBundle
> ("Images/delete_24.png"), UIBarButtonItemStyle.Plain, Handle_EditMode);
>   
> NavigationItem.RightBarButtonItems = new UIBarButtonItem[]
> {_addButton,_editButton};

RightBarButtonItems is an iOS 5 API:

http://developer.apple.com/library/IOs/#documentation/UIKit/Reference/UINavigationItem_Class/Reference/UINavigationItem.html#//apple_ref/doc/uid/TP40006933-CH3-SW19

Check the iOS version of your device.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] UiApplicationDelegate

2011-12-29 Thread Robert Jordan
On 26.12.2011 18:29, Marco Teodoro wrote:
> static void Main(string args)
> {
>#if V2
> UiApplication.Main(args,null,"F5App");
> #else
> UiApplication.Main(args,null,"AppDelegate");
> #endif
> }
>
> So, if the compilation symbol is mine, i instanciate my custom
> UiApplicationDelegate. i have put the [Register("AppDelegate")] attribute
> on my custom class. but i'm getting "Unable to instantiate the
> UIApplication delegate instance. No class named  F5App  is loaded"

You must decorate your app delegate with [Register("F5App")].

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Using the MAC address instead of the unique ID

2012-01-03 Thread Robert Jordan
On 03.01.2012 20:28, bparrott wrote:
> Hello,
>
> I know this has been discussed, but I have a couple new questions.
>
> 1. There was a bug filed on obtaining the MAC address back in November.  Has
> this been fixed?  If not, what is the ETA.
>
> 2. Does anyone have any thoughts on using the MAC address instead of the
> deprecated unique identifier?
>
> I'm using the current stable builds for Mono and Montouch and it does not
> appear to be fixed.

It has been fixed on trunk and 2-10 branch at 12/13/2011.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] App Crashes without Error in Debug Mode

2012-01-03 Thread Robert Jordan
On 03.01.2012 21:35, Andreas Ploetzeneder wrote:
> Hi,
> what can be the reason, if an app crashes, and it makes no error in
> Monotouch? Just Crashing,...
> it is an socket application

It may be a sign that an asynchronous delegate is crashing a
thread pool thread.

Add this to your initialization code:

AppDomain.CurrentDomain.UnhandledException += (sender, e) => {
Console.WriteLine (e.ExceptionObject);
};

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Garbage collection on simulator?

2012-01-08 Thread Robert Jordan
On 08.01.2012 13:12, dermotos wrote:
> Is there some reason why the GC is more agressive on the simulator?

There is a strong reason: the same would happen on the device, albeit
later, less reproducible and much more cumbersome to diagnose.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] monotouch uitableview and accessibility

2012-01-17 Thread Robert Jordan

On 17.01.2012 17:42, chris maley wrote:

hi

I'm using the uitableview without interface builder and want to add voice
over commands to my labels

problem

I need to add voice over commands to each cell so that it is accessible. i
found this code but i have no idea when to call this fuction. Is there away
that I can add this functionality to each cell during data binding to the
uitableview?


Whenever you create (or reuse) a cell, simply invoke
the extension method on the cell object:

UITableViewCell cell;
...
cell.SetAccessibilityLabel("some text");

Robert



http://pastebin.com/0bqJaP0B



___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] monotouch uitableview and accessibility

2012-01-17 Thread Robert Jordan

On 17.01.2012 19:39, chris maley wrote:

thanks rob

I'm creating the cell here

   public override UITableViewCell GetCell (UITableView tableView,
NSIndexPath indexPath)
 {
 UITableViewCell cell = tableView.DequeueReusableCell
(kCellIdentifier);

 if (cell == null)
 {


You must create a cell here:


 cell = new AccessibilityExtensions
(UITableViewCellStyle.Default, kCellIdentifier);
 }

 cell.TextLabel.Text = list[indexPath.Row].Name;
cell.Accessory = 
UITableViewCellAccessory.DisclosureIndicator;


cell.SetAccessibilityLabel("text");



//UITableViewCell cell1 =  new 
AccessibilityExtensions();

 return cell;
 }

is this where i would call the extension?


AccessibilityExtensions is a C# extension class. You can't create 
instances from it.


Add the attached file to your project, and whenever you want to
set an accessibility label to a UIView descendant, you just
invoke the extension method on the instance.

Robert
using System;
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
using MonoTouch.UIKit;

	public static class AccessibilityExtensions
	{
		static Selector selAccessibilityLabel = new Selector("accessibilityLabel");
		static Selector selSetAccessibilityLabel = new Selector("setAccessibilityLabel:");
		
		public static string GetAccessibilityLabel(this UIView view)
		{
			if (view == null)
throw new ArgumentNullException("view");
			
			if (view.RespondsToSelector(selAccessibilityLabel))
return new NSString(Messaging.IntPtr_objc_msgSend(view.Handle, selAccessibilityLabel.Handle));
			else
return null;
		}
		
		public static void SetAccessibilityLabel(this UIView view, string text)
		{
			if (view == null)
throw new ArgumentNullException("view");
			
			if (text == null)
throw new ArgumentNullException("text");
			
			if (view.RespondsToSelector(selSetAccessibilityLabel))
Messaging.void_objc_msgSend_intptr(view.Handle, selSetAccessibilityLabel.Handle,
	new NSString(text).Handle);
		}
	}
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] monotouch uitableview and accessibility

2012-01-17 Thread Robert Jordan

On 17.01.2012 21:19, chris maley wrote:

again rob

thank you for your time. Im a monotouch newbie.

the issue I'm having is how do you invoke the extension?


someObject.SetAccessibilityLabel("text");

where "someObject" is a UIView instance (like a UITableViewCell).

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Book about Mono Mobile (Android and iOS)? Content?

2012-01-23 Thread Robert Jordan

On 23.01.2012 21:34, G. Völkl wrote:


What should be the content?


A side-by-side comparison and dissection of a similar iOS, Android
(and maybe Windows Mobile) application would be very useful.
Something in the style of your great iX article.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Setting a UITableView's Style in code - How?

2012-02-09 Thread Robert Jordan

On 09.02.2012 15:22, MilkyJoe wrote:

Ok... Stupid question time...

I've define my UITableView in code, and I want to set its Style to Grouped.
When I try to use the property, I'm told it's read only:

tableView.Style = UITableViewStyle.Grouped;

How do I set the UIViewTable's Style property at run time?


One of UIViewTable's constructors allows setting the UITableViewStyle.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] SIGSEGV on simulator after upgrade

2012-02-22 Thread Robert Jordan

On 22.02.2012 16:15, thenextman wrote:

I developed an app last year in MonoTouch 4.0.3 for iPhone and iPad.

Now I've come to update that app... My Mac has since been updated to Lion.
So when I launched MD, I allowed it also to update to latest MonoDevelop and
MonoTouch (5.2.5).


Did you update XCode as well? MD 5 requires XCode 4...

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] How do Objective C iOS apps cancel threads so quickly?

2012-02-27 Thread Robert Jordan

On 25.02.2012 21:50, René Ruppert wrote:

one thing I have been wondering about is, how quickly apps written in ObjC
can cancel threads.

Just one example: I have an app where I can check train schedules. I tell it
from where to where and it starts searching. Whenever I click some other
element in the tab bar, the search is interrupted immediately.


I fail to see a correlation between a responsive UI and
the ability to kill threads really fast.


Back in the good old days of .NET I was told: “Thread.Abort()” is evil!
Don’t use!”. So as a .NET developer I always have to abort in a clean way
but that makes apps less responsive. If you have to wait for the next web
call to return, for the next page to be rendered, etc it will be slow(er).


What prevents you from:

- reacting on user interaction (user clicks "Cancel")
- updating the UI to reflect the cancel operation (remove
  spinners, etc.)
- setting a flag in a background thread
- evaluating this flag from the background thread and leave it
  gracefully some time later?


If I check MSDN now, I see that Thread.Abort() will no longer abort finally
clauses. For me this means, Abort() no longer is that evil as it was because
you actually have a chance to clean up using a “finally” clause.


Abort is still cumbersome.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] IntPtr constructor

2012-07-01 Thread Robert Jordan

On 29.06.2012 19:57, Dean Cleaver wrote:

I thought we weren't supposed to create them in our code, but if I don't I get 
this:

System.Exception: Selector invoked from objective-c on a managed object 
(0x9795310) that has been GC'ed

Are we supposed to include them or not?


No. It would only hide the real issue. Ensure that the object
isn't GCed by keeping a reference to it.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] UIImage.FromFile and @2x images

2012-07-05 Thread Robert Jordan

On 05.07.2012 09:45, Mikkel Lønow wrote:

Hi,

FromFile should automatically apply the @2x suffix.


Unlike FromBundle, FromFile does not apply the suffix.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] UIImage.FromFile and @2x images

2012-07-05 Thread Robert Jordan

On 05.07.2012 13:37, Nic Wise wrote:

It doesn't?

I use FromFile everywhere. Always appears to use the @2x version

I suspect I need to double check my code :)



Oh, starting with iOS 4 it does apply the @2x suffix. I think *I* have
to simplify my code ;)

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Popup Bubble?

2012-09-26 Thread Robert Jordan

On 26.09.2012 23:14, Kris Bloom wrote:

I am trying to find out how to do these pup up dialogs that have the pointer… I 
don't even know what this is called.. any help would be awesome!

http://designspike.com/blog/wp-content/uploads/2012/05/Facebook-Pages-Manager-App-Filter-News-Feed.gif


This is a custom view/controller similar to the iOS' iPad-only
UIPopoverController.

You may want to search for "UIPopoverController iphone".

Robert


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] ShouldSerialize Pattern

2012-09-26 Thread Robert Jordan

On 27.09.2012 00:53, Baramuse wrote:

Seems like an "old" but still "new" bug in mono

https://bugzilla.xamarin.com/show_bug.cgi?id=1852

Is there anything to do to speedup things?


This is an undocumented MS.NET feature which is not implemented in
Mono because nobody was aware of it.

I believe you could speed up the implementation by providing
a reliable source of its specification.

Robert


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] SQLCipher ... Best place to store the DB password?

2013-04-16 Thread Robert Jordan

On 16.04.2013 17:42, Matronix wrote:

I am using SQLCipher to create a database on the device. The issue I am
running into is how to keep the password secure? Any suggestions or
recommendation on best practices for this?


If you want to secure a user-chosen password, then you can store
it into iOS' keychain:

http://www.wildsau.net/post/2011/02/01/iOS-Store-passwords-in-the-keychain-using-MonoTouch.aspx

If you want to store an automatically generated hidden
password into the keychain, then the user would lose his
data if the keychain is reset. This might occur if a device
is restored from an unencrypted backup.

Robert

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


  1   2   >