About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
iOS SDK
Author Message
Driklyn Offline
Member

Post: #16
RE: iOS SDK
2) Any news regarding the autorotation modes? This question is also related to #8 below.

7) Including the headers the way you suggested worked great!! lol I've tested the following system headers and they all work without any errors: <Foundation/Foundation.h>, <GameKit/GameKit.h> (GameCenter), <iAd/iAd.h>, <UIKit/UIKit.h>. This is great news! Thank you!

You may want to add this to the Wiki as this is quite important for an iOS app, in my opinion. If you do, don't forget to mention the "Compile Sources As" setting, as it is required in order to use both C++ and Objective-C together (or, I believe you can simply rename the file to .mm instead of .cpp to do the trick as well).

8) Would it be possible to allow us to use our own custom UIApplicationDelegate and UIViewController so that we can override the methods in them? Or, allow us to assign callback functions that will be triggered when the methods occur? I'm assuming the engine is using these classes behind the scenes.

For instance, UIApplicationDelegate has the following methods that are very useful for an iOS app:

– application:didFinishLaunchingWithOptions:
– applicationDidBecomeActive:
– applicationWillResignActive:
– applicationDidEnterBackground:
– applicationWillEnterForeground:
– applicationWillTerminate:
– applicationDidFinishLaunching:


And having access to a UIViewController will allow you to present/dismiss other modal views (such as a UIView containing other native UI elements like UITextView, UIButton, or UISlider) using the following methods:

– presentModalViewController:animated:
– dismissModalViewControllerAnimated:


Also, some third-party libraries require you to pass a UIViewController when initializing said library in order for them to work as well.
09-09-2011 09:46 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #17
RE: iOS SDK
2) added to roadmap

7) added to wiki

8) I'll check this later, once I'll be making Mac/iOS SDK
09-09-2011 10:05 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #18
RE: iOS SDK
7) Cool, thanks. I've managed to successfully upload the Data.pak file included in the Tutorials project to my web server using the ASIHTTPRequest library. Had some trouble including it in the project, but I figured it out. This is a good step for my project. Really glad I managed to stumble across this library -- made something I thought was going to be somewhat difficult into something that was relatively easy to do.

I've learned that setting "Compile Sources As" to Objective-C++ is a bad thing to do! pfft This is because all source files included in your project will be compiled as Objective-C++, meaning Xcode will try to compile ASIHTTPRequest (or any open-source library for that matter) as Objective-C++ and it will fail. So, I switched it back to "According to File Type" and simply renamed "Tutorial.cpp" to "Tutorial.mm". This is the way to do it.
09-10-2011 01:05 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #19
RE: iOS SDK
9) Does Renderer.capture or Renderer.screenShot work in the iOS SDK? Works on the PC, but on the iPhone Simulator, it creates an entire black image:

Code:
Image image;
Renderer.capture(image);
image.Export("screenshot.jpg");

Renderer.screenShot("screenshot.jpg");

I have tried JPG, PNG, and BMP, but it's always just a black image.
09-13-2011 12:27 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #20
RE: iOS SDK
it was working originally, if something broke, I'll check this soon
09-16-2011 11:45 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #21
RE: iOS SDK
10) Does code completion work for you in Xcode? It's barely working at all for me. The only thing it really does is change the text color from black to blue when I've type a valid method/variable. For instance, when typing image.draw( the text will appear blue but if I press 'Esc' to bring up the auto-complete window, it says "No completions found". I have been using the Header Browser tool to get around this little annoyance, but it would be much easier if code completion actually worked. I'm using Xcode 3.2.5 64-bit.

11) TextLine does not make the keyboard appear, meaning it's impossible to edit the text. Is this possible to fix?
09-19-2011 09:44 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #22
RE: iOS SDK
8) Had a breakthrough on this question tonight. Can't believe I completely forgot about [UIApplication sharedApplication]. This returns the singleton application instance. Using this, you can create a class which implements the UIApplicationDelegate protocol and have access to all those application* methods listed in the original post.

This also allowed me to access the main UIWindow, which can be used to add other custom views like the ones I mentioned earlier (UITextField, UIButton, UISlider). For instance, this code will add a UITextField to the screen:

PHP Code:
UIApplication *application = [UIApplication sharedApplication];
UIWindow      *window      = [application.windows objectAtIndex:0];

UITextField *textField = [[UITextField allocinitWithFrame:CGRectMake(202010020)];
[
window addSubview:textField];
[
textField release]; 

I am having one issue with this, however: any subview which is added using [window addSubview:myView] is appearing in portrait mode instead of landscape (I imagine this will be fixed once question #2 is solved).

12) Another problem I am having sounds like it can be solved using the answer on this question on Stack Overflow (or this question, though the answer may trigger a bug according to the comments). Trouble is, I believe this is something that would have to be changed behind-the-scenes in the engine itself.

I will further elaborate on the issue I am having: I have a list of tabular data that be will drawn vertically down the screen. This data is being drawn inside of a Region instance so that you can scroll to the off-screen data. However, I would like to use the touch events from a UIScrollView to scroll through the data in the region, instead of having to use the scrollbars (which is unheard of on iOS devices).

At this point, everything appears to be working fine, except for the fact that while the UIScrollView is scrolling, the region doesn't update. As soon as it stops, it instantly jumps to the new position.
(This post was last modified: 09-20-2011 09:13 AM by Driklyn.)
09-20-2011 09:07 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #23
RE: iOS SDK
11) iOS virtual keyboard is on the roadmap
09-21-2011 10:41 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #24
RE: iOS SDK
8) Figured out how to add UIView's so that they are rotate with the device. You don't want to add them to the UIWindow, but to the EAGLView as this contains the transformation data:

Code:
id eaglView = [window.subviews objectAtIndex:0];
[eaglView addSubview:textField];

11) Alright. I initially tried to implement the virtual keyboard myself by adding a hidden UITextField and activating it whenever you clicked a TextLine (worked but still needed to implement copying the text from the UITextField to the TextLine), but now I've decided just to use the native iOS UI instead of EE's as I believe this will work better for iOS devices.
09-22-2011 09:35 PM
Find all posts by this user Quote this message in a reply
Post Reply