when trying to email contents from text fields im having exceptions thrown. I think im wiring them up wrong.
Im creating outlets for my text fields in .h, setting up my email button as an action.
In .m im implementing usual code for sending email. Ui message frame kit has been imported.
Now I need some help as thats not working for me.
To summarise: How do i email whats in my text boxes?
Im using xcode 4.3 with storyboards
Thanks
There are no tricks to emailing the contents of text boxes. You need help with some exception, you need to provide us the precise error and show us the relevant code. If you want to try to solve it on your own, you should debug the code, single stepping through the method that attempts to email the contents of your text boxes (see Xcode 4 User Guide: Debugging and Analyzing Your Code; see the section about adding breakpoints and then the section about controlling execution).
Exceptions are generally the result of memory management problems (e.g. your code is trying to use some object that has already been released) so you might want to enable zombies if you haven't already. I also think that people do not sufficiently appreciate the value of Xcode's Analyze command on the Product menu (described in the aforementioned Analyzing Your Code section). This Analyze command will identify not only dangling pointers, but also some memory leaks. It's not perfect, but it's a good start.
People really shouldn't be posting questions here if they haven't first resolved the problems raised by Analyze (unless, of course, you need help fixing issues that Analyze raises). Personally, when I went through this Analyze exercise on my first big project, it was painful to clean up all the issues that it identified, but, more importantly, I suddenly "got it". I've been an IT professional for decades, have programmed in dozens (literally) of programming languages, but only after going through this painful exercise did I finally get the subtleties of Objective C memory management. Suddenly, rereading Apple's Advanced Memory Management Programming Guide, it all made perfect sense.
So, if you're still stymied, and the Analyze command did not identify any issues, and you ran the code through the debugger you were not able to identify why the exception was generated, then just provide us a detailed error message and show us the relevant code and I'm sure we'd be happy to help.
Related
I have an iOS app and i'm trying to run automated tests on it using Appium.
Some of my tests are failing because some objects are missing from the DOM tree. But when I look at the simulator screen, I see that those objects are there.
What can possibly create those differences? I'm not even sure who's fault is this -
Is it bad iOS code in it? Is it Apple's fault? Or is it Appium's fault?
Help would be much appreciated
Taking your feedback into account, there could be several reasons why a element does not show up in Appium but clearly visible on the screen of the device/emulator you use. The ones I know off or read about:
It's a OS problem. Appium depends on the accessibility layer from the OS. Updating or downgrading your OS could solve this problem, but no warranty here.
The app is using custom controls. A custom control will only be accessible if the devs that made the controls implemented accessibility for it.
There is also the possibility that you encountered a bug, known or unknown. Be sure to check the Appium github issues for known bugs, or to get help from the devs tackling a new one.
If trying another version of the OS or implementing accessibility does not solve the problem or is not possible, you will need to tap your element using coordinates. This is a last resort solution if everything else fails.
A very useful article on the problems mentioned above can be found here. It also contains all the resources to address these specific problems, like how to tap by coordinates the right way.
I'm an iOS developer from scratch. Currently, I'm learning something about a tableview and getting stuck here. Granted, it's a quite rudimentary issue. But I cannot work it out!
The ideal situation should be a table with the first line of a label and a checkmark. I swear I have followed the tutorial with every step but the table in the simulator was somehow blank. There must be some subtle mistakes. I'm really confused. Now, my operation is fully captured and is enabled in the link. If someone could analyze my operation and point out my mistake I would be gratitude.
hit this link to see my operation from YouTube
hit this link to see my operation from my Google Photos
I noticed in your video you named your custom class as ChecklistViewController, but the Module is none. I don't know why it becomes none because in my project it is Current - Checklists aka your current target. Would you try to click the blue arrow on the left and then, choose the right module. This question may be also helpful.
I am wondering if anyone has experience with having 100+ targets in a single xcode project. I have a case right now where we are building many apps that use the same code base. There is some debate internally that if the amount of apps gets to an unmanageable level aka (Maybe a couple of 1000 apps) we are going to have issues.
So my Question: Does anyone have experience with making a xcode project that has a ton of apps/targets (100+) in one project? Is there any issues with this? Is it easier then having a single project for each one and just sharing code with symbolic links?
I have built a project and made about 80 targets. Besides xcode crashing a couple of times while I was creating them (I think this was because I was using hot-keys and going really fast) it seemed like it was fine. I did not see any major performance hits, but since this was not a full project I am skeptical that this was tested fully.
Thanks for any insight.
So I found some information hidden in a post of a site called openradar. I think it will answer my question. I would love to hear from some real world experience through. So if anyone still has input please add it. I will be doing some more research on the subject.
Link to Post: http://openradar.io/15060709
Also I asked apple for comment on this as well and as soon as I get a response back I will post it in this answer.
TraceGL is a pretty neat project that allows JS programmers to trace code paths in Javascript. It looks something like this:
I'd like to build something similar for Objective C. I know the runtime has made it rather easy to trace method calls, but how would I trace control flow? For example, in the screenshot above, code paths not executed are made obvious with a red highlight. What would be the best way to achieve something similar in an Objective C/Xcode workflow?
The best I've come up with so far is to write a preprocessor that injects code into temporary source files before sending them to the compiler. Anyone have a better idea?
I guess the visualizer for issues found by Xcode's static analyzer comes pretty close to this - albeit this one will only give you the call path for a particular issue like a memory leak.
Try "Product > Analyze" in Xcode, select any of the issues found on any given project and click on the blue arrow in the code editor to see for yourself.
Not exactly answer for Objective C and XCode.
For C++ code there is a industrial quality code coverage tool BullseyeCoverage
Function coverage gives you a quick overview and condition/decision coverage gives you high precision
Works with everything you can write in C++ and C, including system-level and kernel mode
If you want to invent/write this kind of tool yourself I'd recommend to take a look at (evaluate) some existing tools that solve the same task so that you don't miss a key functionality
There are basically 2 categories of such tools
working at binary level, instrument byte code, library entry points etc.
working at source level, instrument source code before going to the compiler
The purpose of the instrumentation is to insert into the code calls to a profiling runtime that collects the runtime statistics for further processing.
Basic calls
timestamp, thread id, source code address, entering
timestamp, thread id, source code address, leaving
The source code address depends on the granularity you are interesetd in. It can be a function name ot it can be a source file and line number.
Collected performance data can be quite huge so they are usually summed-up and whole callstacks are not captured. It is usually sufficient level of detail for detecting performance bottlenecks.
Another drawback is that capturing detailed performance data especially in code points with many hits will slow the application significantly.
If you want complete history then capture the full trace including timestamps and thread-ids and you will be able to recreate the call stacks later knowing that each enter has corresponding leave.
To guarantee this pairing the code instrumentation must insert exception handling calls to make sure that exit point will be logged even if the function throws an exception (what is the "exception" and how to try-finally it dependes on the language and the OS platform).
To get all necessary tricks and tips evaluate some tools and take a look at their instrumentation style.
BTW: in general it is quite a lot of work to do and to get right I'd personally thought twice or more times about what will be the outcome and what will be the costs.
As a want-to-play-with topic I fully recommend that. I created such a tool for troubleshooting Java MIDP applications working at C++ source level and Java binary level and it was helpful at the time when we needed it.
I got an EXC_BAD_ACCESS in my iOS program, and I suspect that the cause is in one of my anonymous blocks, but there are quite a few of those, and I need to narrow down the candidate list a bit.
The stack trace shows the current frame as __lldb_unnamed_function4866$$ProjectName. There are no line numbers or source file names that I can see. No local variables visible either. The debugger shows machine code instructions. This was running on a background event queue, so there is none of my code anywhere else on the stack.
How do I go about finding out what function this is?
I came across a similar situation, and while I can't help (yet) with your problem, I think I know a man who can.
Check out http://www.realmacsoftware.com/blog/block-debugging, for an exposition of how to find out a lot more about the evil block in question.
It doesn't help me much, because I'm working from a crash log, but if you're still interested, this is going to give you just about as much as you can get about the unnamed block.
Warning, the above link exposes you to a lot of arcane knowledge, and may make you feel a little inadequate :)
[Editted to add]
Not good enough yet?
After searching through disassembly and doing some manual symbolication, I came to the conclusion that the ___lldb_unnamed_function is a red herring.
I followed How to manually symbolicate a crash log with atos, and it pointed the finger at a completely different function, which came from a 3rd party library, and was a very good candidate for the crash reason (killed by angry watchdog with badf00d.)
In the course of this enquiry, I also came across hopper, a great disassembler; I used the demo version to confirm what the suspicious code was doing, so I'm giving them a namecheck.
Try to set an exception breakpoint by clicking on the plus symbol within the breakpoint navigator cmd + 6.
For getting an overview of debugging best practices if found it useful to consider a Stanford Lecture on iTunes U