Commit 050b1c0
committed
Add comprehensive error handling and logging to iOS screenshot API
Reverted to dispatch_async to avoid blocking the EDT, but added extensive
error handling and logging to diagnose the NullPointerException.
Changes to IOSNative.m:
- Reverted dispatch_sync back to dispatch_async (don't block EDT)
- Added @try/@catch block to catch Objective-C exceptions
- Added null checks for view, image, PNG data, and byte array
- Added NSLog statements at each step to trace execution
- All error paths now call onScreenshot with nil to complete the callback
Changes to IOSImplementation.java:
- Added try/catch around screenshot() call with logging
- Added try/catch in onScreenshot() with null checks
- Added logging when imageData is null
- Ensured callback is always invoked (with null on error)
This will provide detailed stack traces and logs to identify the exact
location of the NullPointerException.1 parent a0be15b commit 050b1c0
File tree
2 files changed
+71
-25
lines changed- Ports/iOSPort
- nativeSources
- src/com/codename1/impl/ios
2 files changed
+71
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5212 | 5212 | | |
5213 | 5213 | | |
5214 | 5214 | | |
5215 | | - | |
| 5215 | + | |
5216 | 5216 | | |
5217 | | - | |
5218 | | - | |
5219 | | - | |
5220 | | - | |
5221 | | - | |
5222 | | - | |
| 5217 | + | |
| 5218 | + | |
| 5219 | + | |
| 5220 | + | |
| 5221 | + | |
| 5222 | + | |
| 5223 | + | |
| 5224 | + | |
5223 | 5225 | | |
5224 | | - | |
5225 | | - | |
5226 | | - | |
5227 | | - | |
5228 | | - | |
| 5226 | + | |
| 5227 | + | |
| 5228 | + | |
| 5229 | + | |
| 5230 | + | |
| 5231 | + | |
| 5232 | + | |
5229 | 5233 | | |
5230 | | - | |
5231 | | - | |
5232 | | - | |
| 5234 | + | |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
5233 | 5241 | | |
5234 | | - | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
5235 | 5246 | | |
5236 | | - | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
| 5253 | + | |
| 5254 | + | |
| 5255 | + | |
| 5256 | + | |
| 5257 | + | |
| 5258 | + | |
| 5259 | + | |
| 5260 | + | |
5237 | 5261 | | |
5238 | 5262 | | |
5239 | 5263 | | |
| |||
Lines changed: 30 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
320 | 342 | | |
321 | 343 | | |
322 | 344 | | |
| |||
0 commit comments